Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #67735

Re: Proper conversion of timestamp

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ikorot01@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.039
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'mrab': 0.05; 'lawrence': 0.09; 'referenced': 0.09; 'python': 0.11; 'language.': 0.14; 'igor': 0.16; 'mark,': 0.16; 'op.': 0.16; 'skip:q 50': 0.16; 'timestamp': 0.16; 'language': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'trying': 0.19; 'value.': 0.19; '>>>': 0.22; 'to:name:python- list@python.org': 0.22; '---': 0.24; 'question': 0.24; '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; 'could': 0.34; 'problem': 0.35; 'something': 0.35; 'convert': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'described': 0.36; 'url:listinfo': 0.36; 'hi,': 0.36; 'url:org': 0.36; '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; 'free': 0.61; 'new': 0.61; 'viruses': 0.61; 'range': 0.61; 'course': 0.61; 'first': 0.61; 'you.': 0.62; 'protection': 0.63; 'our': 0.64; 'mar': 0.68; 'antivirus': 0.68; 'divide': 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=WQOBNqJYxEwwGKyTqxew5nwa/GSXRAPoNWQO7M/4cRo=; b=DfqZqmrQKv3cmYbSe02nq0FM9MU9ZPGHAaGDd78zC8OGzg+jDnrsBzfJ9Wl7M+fErw 4AUuLAZ+ZsYcnD2LKHrqzF2tAk/r350q6tDo5K/5MFb08cKTpkbtEf+nkjK3JSUVVJkG 0vwMiDQREUR1T9kiA13+HavUaLccDVzi5bcFtS3ZbidO7ylz6h6ZWIYReJZfz4/PpWKd WCWWuajpdt77iD4aDwXKpMNNhvOepQx5mYkB0nwB3kCiJEKh6UjckUZ65cgB1aqMsn9R vrB4UmW1F7pZpzJ5xz5e4cOICvqjW087kMbZQIULhEKOKxG1tNUui/P8X1uqOpSQqMra Kl6A==
MIME-Version 1.0
X-Received by 10.52.81.66 with SMTP id y2mr1248332vdx.23.1393970276532; Tue, 04 Mar 2014 13:57:56 -0800 (PST)
In-Reply-To <lf5hi6$ve3$2@ger.gmane.org>
References <CA+FnnTy2zoJYzx+ExkHf8SsENppBLaQzp2zOC9WFYsLBYwK9Qg@mail.gmail.com> <531647BE.70104@mrabarnett.plus.com> <lf5hi6$ve3$2@ger.gmane.org>
Date Tue, 4 Mar 2014 13:57:56 -0800
Subject Re: Proper conversion of timestamp
From Igor Korot <ikorot01@gmail.com>
To "python-list@python.org" <python-list@python.org>
Content-Type multipart/alternative; boundary=001a1136776a290d8e04f3cefff7
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7752.1393970284.18130.python-list@python.org> (permalink)
Lines 140
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1393970284 news.xs4all.nl 2864 [2001:888:2000:d::a6]:55943
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67735

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Mark,


On Tue, Mar 4, 2014 at 1:45 PM, Mark Lawrence <breamoreboy@yahoo.co.uk>wrote:

> On 04/03/2014 21:38, 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.
>>
>>
> You learn something new every day, I wasn't aware that you could multiply
> or divide timestamps.


Of course you can. Its just the number.
And this is exactly what happens on the stackoverflow question I referenced
in the OP.
Problem is I want the milliseconds in the datetime object.

Thank you.


>
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask what
> you can do for our language.
>
> Mark Lawrence
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Proper conversion of timestamp Igor Korot <ikorot01@gmail.com> - 2014-03-04 13:57 -0800

csiph-web