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


Groups > comp.lang.python > #65651

datetime formatting output

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.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.192
X-Spam-Level *
X-Spam-Evidence '*H*': 0.63; '*S*': 0.02; 'debugger': 0.09; 'stored': 0.12; '23,': 0.16; 'all,': 0.19; 'post': 0.26; 'message- id:@mail.gmail.com': 0.30; 'display': 0.35; 'received:google.com': 0.35; 'shows': 0.36; 'hi,': 0.36; 'thank': 0.38; 'to:addr:python- list': 0.38; 'previous': 0.38; '12,': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'field.': 0.61; 'you.': 0.62; 'field': 0.63; 'as:': 0.81; 'milliseconds': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=vaOxzLIuho8Khqj+x+wp0okz4iH3TMbz/0VZw9wJz30=; b=JBrqNOYM6zYatmeHfl0jETPsTcSFtMQMYkEXa7y6EcRIz6iGSyy2oFf+R8pFzqUFao 9EwYRjhtj7K1MzCc5Vy4khoMY+8CVMZmdApzpjhlAtKS2MzwkC2TOryD8sJFPBtYV1lV errDNDIROKpgN0EINPyfedQNxFXEHTe7qWpZ6Li7SOllyNxdnWqStOlyJTOXPO75LWf3 tRqD4icY9cbaJ3ifeLICgUzsZ+Ix21rr1vQ9Pt4oM/WId7Ekkar4AF9tvf1NmSzS7UBe CraiG6GTToWRbP0recgiveq02bzXmh+a9Mwyl2wm5v/8R8zxd65Y7ws2N/F//e0ToXYl Wgiw==
MIME-Version 1.0
X-Received by 10.58.229.164 with SMTP id sr4mr14261501vec.18.1391848859235; Sat, 08 Feb 2014 00:40:59 -0800 (PST)
Date Sat, 8 Feb 2014 00:40:59 -0800
Subject datetime formatting output
From Igor Korot <ikorot01@gmail.com>
To python-list@python.org
Content-Type multipart/alternative; boundary=047d7bd6bbf2d5fcc104f1e11090
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.6527.1391848868.18130.python-list@python.org> (permalink)
Lines 39
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391848868 news.xs4all.nl 2871 [2001:888:2000:d::a6]:43129
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65651

Show key headers only | View raw


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

Hi, ALL,
I am reading data from the DB (mySQL) where the datetime field is stored as:

2012-12-12 23:59:59.099

When I retrieve this date I am successfully see under debugger the
dateteime object with (2012, 12, 12, 23, 59, 59, 099)

However as you can see from my previous post this date shows up incorrectly
as:

2012-12-12 23:59:59.000099

Notice 3 extra 0's in the milliseconds field.

How do I display this datetime object properly?

Thank you.

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


Thread

datetime formatting output Igor Korot <ikorot01@gmail.com> - 2014-02-08 00:40 -0800

csiph-web