1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 23:02:26 +00:00

Fixed datetime convertion error in windows.

This commit is contained in:
zhengxie
2013-07-09 14:12:51 +08:00
committed by lins05
parent fd9adcd3a3
commit b3b8a82d89

View File

@@ -160,7 +160,8 @@ def translate_seahub_time(value):
val_ts = value
val = datetime.fromtimestamp(val_ts) # convert timestamp to datetime
elif isinstance(value, datetime):
val_ts = int(value.strftime("%s"))
# FIXME: convert datetime to timestamp may cause problem, need a better way.
val_ts = int(time.mktime(value.timetuple()))
val = value
else:
return value