title: converting 13-digit unixtime in ms to timestamp in python
body: <p>I want to convert 13-digit Unix-time in milliseconds to the timestamp :</p>
  
  <p>"1523126888080"==>> %Y-%m-%d %H:%M:%S</p>
  
  <p>I have tried the following code from this <a href="http://foo.com" rel="noreferrer">link</a>,<br> But I think this is for 10-digit Unix-time and I am having 13-digit Unix-time. So,</p>
  
  <p>This code is working, But it is giving the wrong results and wrong time:</p>
  
  <pre><code>import time
  time.strftime("%D %H:%M", time.localtime(int("1523126888080".strip()[0:9])))
  
  Output: '1974-10-30 02:34:48'
  Expected: '2018-04-08 12:18:08'
  </code></pre>
  
  <p>But this one is giving error: </p>
  
  <pre><code>import time
  time.strftime("%D %H:%M", time.localtime(int("1523126888080")))
  
  Traceback (most recent call last):
  File "&lt;pyshell#1&gt;", line 1, in &lt;module&gt;
  time.strftime("%D %H:%M", time.localtime(int("1523126888080")))
  OSError: [Errno 22] Invalid argument
  </code></pre>