Skip to content

Commit

Permalink
Merge pull request #69 from emotional-cities/timezone-aware
Browse files Browse the repository at this point in the history
Use timezone aware objects for record timestamps
  • Loading branch information
glopesdev authored Oct 21, 2024
2 parents a372944 + 0b3845a commit d31bac2
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 d31bac2

Please sign in to comment.