Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'python': 0.11; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'igor': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'timestamp': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'trying': 0.19; 'value.': 0.19; 'header:User-Agent:1': 0.23; 'this:': 0.26; 'header:In- Reply-To:1': 0.27; 'function': 0.29; "i'm": 0.30; 'gives': 0.31; 'getting': 0.31; 'object.': 0.31; 'convert': 0.35; 'received:84': 0.35; 'but': 0.35; 'google': 0.35; 'described': 0.36; 'hi,': 0.36; 'thank': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'range': 0.61; 'first': 0.61; 'you.': 0.62; 'milliseconds': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=JLW1sq6b c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=sASEtNAQL0YA:10 a=1K8QQjYBxE4A:10 a=ihvODaAuJD4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=uPZiAMpXAAAA:8 a=PYiRK579n4cr8qYl-hAA:9 a=QEXdDO2ut3YA:10 a=kKlv5diQZ1kA:10 X-AUTH: mrabarnett:2500 Date: Tue, 04 Mar 2014 21:38:06 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Proper conversion of timestamp References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393969089 news.xs4all.nl 2976 [2001:888:2000:d::a6]:35473 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67725 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.