Skip to content

Commit c5a6564

Browse files
author
Phil Varner
authored
Merge pull request #40 from stac-utils/pv/replace-use-of-RFC339
replace use of RFC339 constant with equivalent code
2 parents b097027 + 07e448b commit c5a6564

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/transactions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"""transactions extension client."""
22

33
import logging
4-
from datetime import datetime
4+
from datetime import datetime, timezone
55

66
import attr
77
import elasticsearch
88
from elasticsearch import helpers
9-
from stac_pydantic.shared import DATETIME_RFC339
109

1110
from stac_fastapi.elasticsearch.config import ElasticsearchSettings
1211
from stac_fastapi.elasticsearch.serializers import CollectionSerializer, ItemSerializer
@@ -104,7 +103,7 @@ def create_collection(self, model: stac_types.Collection, **kwargs):
104103
def update_item(self, model: stac_types.Item, **kwargs):
105104
"""Update item."""
106105
base_url = str(kwargs["request"].base_url)
107-
now = datetime.utcnow().strftime(DATETIME_RFC339)
106+
now = datetime.now(timezone.utc).isoformat().replace("+00:00", "Z")
108107
model["properties"]["updated"] = str(now)
109108

110109
if not self.client.exists(index="stac_collections", id=model["collection"]):

0 commit comments

Comments
 (0)