Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Greg Donald
On Tue, Dec 11, 2012 at 11:05 PM, Steven D'Aprano wrote: > The question is not "will it parse", but will it parse CORRECTLY? > > What will it parse 11/12/10 as, and how do you know that is the intended > date? If it were me I'd look at more of the source dates I was tasked with parsing and dial i

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Greg Donald
On Tue, Dec 11, 2012 at 2:18 PM, Marc Christiansen wrote: parse('1. Januar 2013') > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib64/python3.3/site-packages/dateutil/parser.py", line 720, in > parse > return DEFAULTPARSER.parse(timestr, **kwargs) > File

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Steven D'Aprano
On Tue, 11 Dec 2012 02:35:29 -0600, Greg Donald wrote: > On Mon, Dec 10, 2012 at 10:34:31PM -0700, Michael Torrie 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 wo

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Marc Christiansen
Greg Donald wrote: > On Mon, Dec 10, 2012 at 10:34:31PM -0700, Michael Torrie 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 A

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread noydb
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: > > > 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 > > > accura

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Greg Donald
On Mon, Dec 10, 2012 at 10:34:31PM -0700, Michael Torrie 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'

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Chris Angelico
n Tue, Dec 11, 2012 at 7:25 PM, Michael Torrie wrote: > On 12/11/2012 01:08 AM, Chris Angelico wrote: >> 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'v

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Michael Torrie
On 12/11/2012 01:08 AM, Chris Angelico wrote: > 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. Also what I meant was common "eng

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Michael Torrie
On 12/11/2012 01:08 AM, Chris Angelico wrote: > 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. For the record I didn't write the module, so I don't care whether o

Re: strptime - dates formatted differently on different computers

2012-12-11 Thread Chris Angelico
On Tue, Dec 11, 2012 at 4:34 PM, Michael Torrie 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 throw

Re: strptime - dates formatted differently on different computers

2012-12-10 Thread Michael Torrie
On 12/10/2012 02:18 PM, noydb wrote: > Follow-on question to this earlier topic - > https://groups.google.com/d/topic/comp.lang.python/wnUlPBBNah8/discussion > > Was curious to know if there was a way to handle different user computers > with different operating system set date formats. 2/10/2

Re: strptime - dates formatted differently on different computers

2012-12-10 Thread Steven D'Aprano
On Mon, 10 Dec 2012 16:36:37 -0500, Dave Angel wrote: > When accepting input from a user, consider their environment. Perhaps > they're in a different timezone than your program (or your native > location), or use some other ordering for the date (for example, the > Japanese sensibly put year fir

Re: strptime - dates formatted differently on different computers

2012-12-10 Thread Dave Angel
On 12/10/2012 04:18 PM, noydb wrote: > Follow-on question to this earlier topic - > https://groups.google.com/d/topic/comp.lang.python/wnUlPBBNah8/discussion For those who avoid googlegroups with a passion, and/or don't have internet access, the subject of that thread is "date-time comparison, a

Re: strptime - dates formatted differently on different computers

2012-12-10 Thread noydb
NTFS partition Windows 7 Python 2.7 -- http://mail.python.org/mailman/listinfo/python-list

strptime - dates formatted differently on different computers

2012-12-10 Thread noydb
Follow-on question to this earlier topic - https://groups.google.com/d/topic/comp.lang.python/wnUlPBBNah8/discussion Was curious to know if there was a way to handle different user computers with different operating system set date formats. 2/10/2006 vs 2-10-2006, for example. Not an issue f