<div dir="ltr">MRAB,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 4, 2014 at 1:38 PM, MRAB <span dir="ltr"><<a href="mailto:python@mrabarnett.plus.com" target="_blank">python@mrabarnett.plus.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 2014-03-04 20:57, Igor Korot wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, ALL,<br>
I'm getting this:<br>
<br>
timestamp out of range for platform localtime()/gmtime() function<br>
<br>
trying to convert the timestamp with milliseconds into the datetime object.<br>
<br>
The first hit of Google gives me this:<br>
<br>
<a href="http://stackoverflow.com/questions/12458595/convert-epoch-timestamp-in-python" target="_blank">http://stackoverflow.com/<u></u>questions/12458595/convert-<u></u>epoch-timestamp-in-python</a><br>
<br>
but the solution described is not good for me since it does not gives<br>
me the milliseconds value.<br>
<br>
How do I get the proper datetime value including milliseconds from the<br>
timestamp?<br>
<br>
Thank you.<br>
<br>
</blockquote></div></div>
Are you using Python 2? If yes, then try dividing by 1000.0.<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>Yes, I'm using python 2.7.<br></div><div>But dividing by 1000 will give the precision in seconds, i.e. "YYYY-MM-DD HH:MM:SS".<br>
<br></div><div>What I want is to have this: "YYYY-MM-DD HH:MM:SS.XXX", where "XXX" is a milliseconds.<br><br></div><div>Thank you.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888">
<br>
-- <br>
<a href="https://mail.python.org/mailman/listinfo/python-list" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br></div></div>