python - what kind of epoch time is this -
I have an era's time value: when I By converting python using this date and time, I get a strange date, it is done as follows: What type of era is that? How can I get my local system time in a similar format using Python? has been in Timestamp millisecond from the time of the era, it probably came from Java That is where this type of timestamp is standard. To make it usable with To get time in this format, use 1412835422648
& gt; & Gt; & Gt; Import time & gt; & Gt; & Gt; Time.strftime ('% Y-% m-% d% H:% M:% S', time.Locetime (1412835422648)) '46740-12-22 07:04:08'
time.localtime () , to convert it into seconds, divide by 1000:
In [2]: time.strftime ('% Y-% m-% d% H:% M:% S', time.Locetime (1412835422648/1000)) [2]: '2014-10-09 07:17 : 02 '
time.time () , multiply by 1000 as result and round in round: / p>
in [4]: int (time.time () * 1000 + 0.5) out [4]: 1412836344862L
Comments
Post a Comment