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


Groups > comp.lang.python > #34601

Re: strptime - dates formatted differently on different computers

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'parser': 0.07; 'plenty': 0.07; 'pypi': 0.07; 'accuracy.': 0.09; 'thrown': 0.09; 'dec': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:dates': 0.16; 'wrote:': 0.17; 'test.': 0.17; 'thorough': 0.17; 'handles': 0.18; 'module': 0.19; 'sort': 0.21; 'statement': 0.23; "i've": 0.23; 'header:In-Reply-To:1': 0.25; 'common': 0.26; 'message-id:@mail.gmail.com': 0.27; '11,': 0.33; 'european': 0.33; 'handle': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'formats': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'michael': 0.36; 'but': 0.36; 'enough': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'header:Received:5': 0.40; 'most': 0.61; "you've": 0.61; 'more': 0.63; 'obvious': 0.71; 'american': 0.73
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=BCpCAA62XJVKCx9Rr9potckJgHijkooDt72Mf2Lr3oA=; b=x+Hp6z1749REAk2OU1/V9+I81cwq1FNBJFJZk8k6hdrHzwjO31Rys/hIQt7O7qlw0l PqmsgYG1yoxcyb/ieNyDs0xsWRaQnJgC8HZQy3FMF/+Y2+hgIClxEp9Z7uK+n6/SXKWJ p6yzPWR5CtJf2S1Qd4nvtNb/BvKiabNvFc2ZWcvN4W4PCVELupkVF/lx3pddyDzA3KxF 7NFmX/U8lF3FXbOwKLcHnp/YSjQqjL/VuU5kxGmlBJMcty7qDsUmXK1PIYiuqzvuDN8j ivEfPS3YhxD87p7vkOhpq/oRd1CanJ2d3TyqXbudYjIAmg0gZeOJyMpsfKcEQ/B/Ta4d KNiw==
MIME-Version 1.0
In-Reply-To <50C6C5E7.1030300@gmail.com>
References <d564ab7b-9259-4460-813a-10a41e0fcd64@googlegroups.com> <50C6C5E7.1030300@gmail.com>
Date Tue, 11 Dec 2012 19:08:18 +1100
Subject Re: strptime - dates formatted differently on different computers
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.711.1355213302.29569.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355213302 news.xs4all.nl 6955 [2001:888:2000:d::a6]:36548
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:34601

Show key headers only | View raw


On Tue, Dec 11, 2012 at 4:34 PM, Michael Torrie <torriem@gmail.com> wrote:
> I use a module I got from pypi called dateutil.  It has a nice submodule
> called parser that can handle a variety of date formats with good
> accuracy.  Not sure how it works, but it handles all the common American
> date formats I've thrown at it.

That sort of statement will get you either amusement or ire, depending
on the respondent. From me, amusement, because there are enough
"common American date formats" for you to feel you've done a thorough
test.

There are a LOT more date formats than those used in the USA. The most
obvious trio is American MDY, European DMY, Japanese YMD, but there
are plenty more to deal with. Have fun.

ChrisA

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


Thread

strptime - dates formatted differently on different computers noydb <jenn.duerr@gmail.com> - 2012-12-10 13:18 -0800
  Re: strptime - dates formatted differently on different computers noydb <jenn.duerr@gmail.com> - 2012-12-10 13:22 -0800
  Re: strptime - dates formatted differently on different computers Dave Angel <d@davea.name> - 2012-12-10 16:36 -0500
    Re: strptime - dates formatted differently on different computers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-11 02:07 +0000
  Re: strptime - dates formatted differently on different computers Michael Torrie <torriem@gmail.com> - 2012-12-10 22:34 -0700
  Re: strptime - dates formatted differently on different computers Chris Angelico <rosuav@gmail.com> - 2012-12-11 19:08 +1100
  Re: strptime - dates formatted differently on different computers Michael Torrie <torriem@gmail.com> - 2012-12-11 01:23 -0700
  Re: strptime - dates formatted differently on different computers Michael Torrie <torriem@gmail.com> - 2012-12-11 01:25 -0700
  Re: strptime - dates formatted differently on different computers Chris Angelico <rosuav@gmail.com> - 2012-12-11 19:32 +1100
  Re: strptime - dates formatted differently on different computers Greg Donald <gdonald@gmail.com> - 2012-12-11 02:35 -0600
    Re: strptime - dates formatted differently on different computers noydb <jenn.duerr@gmail.com> - 2012-12-11 06:52 -0800
    Re: strptime - dates formatted differently on different computers noydb <jenn.duerr@gmail.com> - 2012-12-11 06:52 -0800
    Re: strptime - dates formatted differently on different computers Marc Christiansen <usenet@solar-empire.de> - 2012-12-11 21:18 +0100
      Re: strptime - dates formatted differently on different computers Greg Donald <gdonald@gmail.com> - 2012-12-11 23:28 -0600
    Re: strptime - dates formatted differently on different computers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-12 05:05 +0000
      Re: strptime - dates formatted differently on different computers Greg Donald <gdonald@gmail.com> - 2012-12-11 23:29 -0600

csiph-web