Skip to content

Commit d31bac2

Browse files
authored
Merge pull request #69 from emotional-cities/timezone-aware
Use timezone aware objects for record timestamps
2 parents a372944 + 0b3845a commit d31bac2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pluma/export/ogcapi/records.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pandas as pd
44
from pathlib import Path
55
from geopandas import GeoDataFrame
6-
from datetime import datetime
6+
from datetime import datetime, timezone
77

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

0 commit comments

Comments
 (0)