python - what kind of epoch time is this -


I have an era's time value: 1412835422648

when I By converting python using this date and time, I get a strange date, it is done as follows:

  & 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'   

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 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 '  

To get time in this format, use time.time () , multiply by 1000 as result and round in round: / p>

  in [4]: ​​int (time.time () * 1000 + 0.5) out [4]: ​​1412836344862L    

Comments

Popular posts from this blog

mysql - where clause in inner join query -

java - Why my included JSP file won't get processed correctly? -

php - MySQL Query for Advanced Search multiple criteria -