Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'locale': 0.07; 'parser': 0.07; 'pypi': 0.07; 'works.': 0.07; 'python': 0.09; 'accuracy.': 0.09; 'throw': 0.09; 'thrown': 0.09; 'timestamps': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'steve': 0.13; 'dec': 0.15; '(windows': 0.16; 'doesnt': 0.16; 'it..': 0.16; 'subject:dates': 0.16; 'mon,': 0.16; 'string': 0.17; 'wrote:': 0.17; 'handles': 0.18; 'module': 0.19; 'bit': 0.21; 'import': 0.21; 'greg': 0.22; 'parse': 0.22; 'sorry,': 0.22; 'cc:2**0': 0.23; 'purposes': 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'tried': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '---': 0.26; 'common': 0.26; 'necessary.': 0.27; '-0700,': 0.29; "i'm": 0.29; 'function': 0.30; 'december': 0.32; '11,': 0.33; 'crazy': 0.33; 'handle': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'whatever': 0.35; 'formats': 0.35; "won't": 0.35; 'received:209.85': 0.35; 'michael': 0.36; 'but': 0.36; 'anything': 0.36; 'should': 0.36; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'sure': 0.38; 'called': 0.39; 'lost': 0.60; 'kind': 0.61; 'offer': 0.65; 'american': 0.73; 'donald': 0.84; 'newbie,': 0.84 Newsgroups: comp.lang.python Date: Tue, 11 Dec 2012 06:52:29 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=198.102.41.250; posting-account=1oR0EAoAAAANUNTZzTcJtVHDa9M690er References: <50C6C5E7.1030300@gmail.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 198.102.41.250 MIME-Version: 1.0 Subject: Re: strptime - dates formatted differently on different computers From: noydb To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: , Message-ID: Lines: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355237559 news.xs4all.nl 6944 [2001:888:2000:d::a6]:45416 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34623 On Tuesday, December 11, 2012 3:35:29 AM UTC-5, Greg Donald wrote: > On Mon, Dec 10, 2012 at 10:34:31PM -0700, Michael Torrie wrote: >=20 > > I use a module I got from pypi called dateutil. It has a nice submodul= e >=20 > > called parser that can handle a variety of date formats with good >=20 > > accuracy. Not sure how it works, but it handles all the common America= n >=20 > > date formats I've thrown at it. >=20 >=20 >=20 > from dateutil.parser import parse >=20 > dt =3D parse( whatever ) >=20 >=20 >=20 > I've throw all kind of date and timestamps at it.. have yet to see anythi= ng it won't parse. >=20 >=20 >=20 >=20 >=20 > -- >=20 > Greg Donald Thanks - I tried this (dateutil.parser import parsed...), and it works. I'= m skeptical of it working for any crazy date string thrown at it, but for m= y purposes it should suffice -- and my purposes for now was purely just cur= iousity on how to handle if it became necessary. I tried figuring out Steve D'Aprano's solution above on my system (windows = 7, python 2.7) - no luck. Sorry, I am a newbie, so I'm a bit lost on this = --- my locale module doesnt offer a nl_langinfo function -- why would this = be?