Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.057 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'mrab': 0.05; 'python': 0.11; 'igor': 0.16; 'seconds,': 0.16; 'skip:q 50': 0.16; 'timestamp': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'trying': 0.19; 'value.': 0.19; 'to:name:python-list@python.org': 0.22; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'gives': 0.31; 'getting': 0.31; 'object.': 0.31; 'url:python': 0.33; 'convert': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'described': 0.36; 'i.e.': 0.36; 'url:listinfo': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'skip:& 10': 0.38; 'thank': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'how': 0.40; 'range': 0.61; 'first': 0.61; 'you.': 0.62; 'mar': 0.68; '2.7.': 0.84; 'milliseconds': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=brkfVKNrza1wjfmV4HV4f7ycvVguJVSoUgD30GYq4to=; b=nMjg1qsiO2vu1suSAISmQFcO27YeydR7ufoEfHlKnfTlDygB97sdrfNIKBsp3hSreW JRPtzAr4K/7bOQ4f2u0+tuaKxjl7P8H/yDu3G8ctMo6PGSlZ7CaGl34EI6ZxjDVoEn/Z aDyWHiVNXB/C9odSqY2Yr8hDJBghVKG0iwvccCgkMaRac/I9qQu8EmojWdJ9kIEdOONV gfLvpVOZ0smKuWa6gKik4DukNZE8K95ynwv3eKpsvaUGcS+He0EGMxZlSaNAl12Tqcu+ IYSpOx/GLVPqvjGeqfbHuEWkvewjSL3/7qBeTFJisNLL9PkIVn0hZCFvbgulyfJc4wV5 nMAw== MIME-Version: 1.0 X-Received: by 10.58.200.168 with SMTP id jt8mr1533443vec.30.1393969581337; Tue, 04 Mar 2014 13:46:21 -0800 (PST) In-Reply-To: <531647BE.70104@mrabarnett.plus.com> References: <531647BE.70104@mrabarnett.plus.com> Date: Tue, 4 Mar 2014 13:46:21 -0800 Subject: Re: Proper conversion of timestamp From: Igor Korot To: "python-list@python.org" Content-Type: multipart/alternative; boundary=047d7bd6bd76b931c204f3ced5dd X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 102 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393969584 news.xs4all.nl 2878 [2001:888:2000:d::a6]:44684 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67729 --047d7bd6bd76b931c204f3ced5dd Content-Type: text/plain; charset=ISO-8859-1 MRAB, On Tue, Mar 4, 2014 at 1:38 PM, MRAB wrote: > On 2014-03-04 20:57, Igor Korot wrote: > >> Hi, ALL, >> I'm getting this: >> >> timestamp out of range for platform localtime()/gmtime() function >> >> trying to convert the timestamp with milliseconds into the datetime >> object. >> >> The first hit of Google gives me this: >> >> http://stackoverflow.com/questions/12458595/convert- >> epoch-timestamp-in-python >> >> but the solution described is not good for me since it does not gives >> me the milliseconds value. >> >> How do I get the proper datetime value including milliseconds from the >> timestamp? >> >> Thank you. >> >> Are you using Python 2? If yes, then try dividing by 1000.0. > Yes, I'm using python 2.7. But dividing by 1000 will give the precision in seconds, i.e. "YYYY-MM-DD HH:MM:SS". What I want is to have this: "YYYY-MM-DD HH:MM:SS.XXX", where "XXX" is a milliseconds. Thank you. > > -- > https://mail.python.org/mailman/listinfo/python-list > --047d7bd6bd76b931c204f3ced5dd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
MRAB,


On Tue, Mar 4, 2014 at 1:38 PM, MRAB <python@mrabarn= ett.plus.com> wrote:
On 2= 014-03-04 20:57, Igor Korot wrote:
Hi, ALL,
I'm getting this:

timestamp out of range for platform localtime()/gmtime() function

trying to convert the timestamp with milliseconds into the datetime object.=

The first hit of Google gives me this:

http://stackoverflow.com/questions/= 12458595/convert-epoch-timestamp-in-python

but the solution described is not good for me since it does not gives
me the milliseconds value.

How do I get the proper datetime value including milliseconds from the
timestamp?

Thank you.

Are you using Python 2? If yes, then try dividing by 1000.0.

Yes, I'm using python 2.7.
But dividing by 1000 w= ill give the precision in seconds, i.e. "YYYY-MM-DD HH:MM:SS".
What I want is to have this: "YYYY-MM-DD HH:MM:SS.XXX&q= uot;, where "XXX" is a milliseconds.

Thank you.=
=A0

--
https://mail.python.org/mailman/listinfo/python-list

--047d7bd6bd76b931c204f3ced5dd--