Skip to content

Commit

Permalink
Use timezone aware objects for record timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Oct 21, 2024
1 parent a372944 commit 0b3845a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pluma/export/ogcapi/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd
from pathlib import Path
from geopandas import GeoDataFrame
from datetime import datetime
from datetime import datetime, timezone

from pluma.schema import Dataset
from dataclasses import dataclass, field, fields
Expand Down Expand Up @@ -46,7 +46,7 @@ def __init__(self, dataset: Dataset, gdf: GeoDataFrame, properties: RecordProper
self.id = f"{root_path.name.lower()}"
self.start_date = gdf.index[0]
self.end_date = gdf.index[-1]
self.created_timestamp = pd.Timestamp(datetime.utcnow())
self.created_timestamp = pd.Timestamp(datetime.now(timezone.utc))
self.updated_timestamp = self.created_timestamp
self.resolution = isodate.duration_isoformat(pd.Timedelta(gdf.index.freq))
self.bounds = gdf.total_bounds
Expand Down

0 comments on commit 0b3845a

Please sign in to comment.