Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit 14bfd5d

Browse files
committed
Fix template mistake in entitytype
1 parent f93f4bc commit 14bfd5d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/onedrivesdk/model/item.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,15 @@ def created_date_time(self):
8282
The createdDateTime
8383
"""
8484
if "createdDateTime" in self._prop_dict:
85-
time_string = "%Y-%m-%dT%H:%M:%S"
86-
if (self._prop_dict["createdDateTime"].microsecond != 0):
87-
time_string += ".%f"
88-
return datetime.strptime(self._prop_dict["createdDateTime"].replace("Z", ""), time_string)
85+
time_format = "%Y-%m-%dT%H:%M:%S.%f"
86+
return datetime.strptime(self._prop_dict["createdDateTime"], time_format)
8987
else:
9088
return None
9189

9290
@created_date_time.setter
9391
def created_date_time(self, val):
94-
self._prop_dict["createdDateTime"] = val.isoformat()+"Z"
92+
time_format = "%Y-%m-%dT%H:%M:%S.%f"
93+
self._prop_dict["createdDateTime"] = val.strftime(time_format)
9594

9695
@property
9796
def c_tag(self):
@@ -197,16 +196,15 @@ def last_modified_date_time(self):
197196
The lastModifiedDateTime
198197
"""
199198
if "lastModifiedDateTime" in self._prop_dict:
200-
time_string = "%Y-%m-%dT%H:%M:%S"
201-
if (self._prop_dict["lastModifiedDateTime"].microsecond != 0):
202-
time_string += ".%f"
203-
return datetime.strptime(self._prop_dict["lastModifiedDateTime"].replace("Z", ""), time_string)
199+
time_format = "%Y-%m-%dT%H:%M:%S.%f"
200+
return datetime.strptime(self._prop_dict["lastModifiedDateTime"], time_format)
204201
else:
205202
return None
206203

207204
@last_modified_date_time.setter
208205
def last_modified_date_time(self, val):
209-
self._prop_dict["lastModifiedDateTime"] = val.isoformat()+"Z"
206+
time_format = "%Y-%m-%dT%H:%M:%S.%f"
207+
self._prop_dict["lastModifiedDateTime"] = val.strftime(time_format)
210208

211209
@property
212210
def name(self):

0 commit comments

Comments
 (0)