Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Pyttles

Name: Anonymous 2008-06-12 11:40

I want to be able to parse a date and time string for the locale set in the user's system using forced indentation. I also want it to be flexible so it first tries to parse a full date and time, if that fails it tries full date with hours and minutes and lastly just a date in case the user doesn't want to specify the time or doesn't want to bother with seconds.
Neither time.strptime nor datetime.datetime.strptime seems to care about locale settings on my system (on the other hand, strftime for both modules does). What is this bullshit? Should I just force the users to wrap their heads around ISO 8601?

Name: Anonymous 2008-06-12 12:11

Yes. It's not like ISO 8601 is hard.
If your users are really stupid you can give them some dropdown boxes or that Windows date pick thing.

Name: Anonymous 2008-06-12 14:03

Not that it helps you at all, Cocoa's date parser knows how to parse "a week ago at dinner time".

Name: Anonymous 2008-06-12 15:18

Unfortunately, they decided not to bother with anything like that in Python. See http://www.python.org/dev/peps/pep-0321/

Name: Anonymous 2008-06-12 16:06

>>3
Yeah, because that works in spanish, russian, chinese, and Lojban too. Enjoy your niche market.

Name: Anonymous 2008-06-12 16:59

>>5
English is the international lingua franca, and is therefore more important than any of the languages you listed.

Name: Anonymous 2008-06-12 17:01

>>6
Shut up, Cudder.

Name: Anonymous 2008-06-12 17:41

>>2
8601 is simple, but I prefer the YYYYMMDDHHmmSS format.

Name: Anonymous 2008-06-12 17:47

Name: Anonymous 2008-06-12 20:18

>>1
Don't. Don't make your program try to parse several kinds of dates, that's just going to cause problems.

I hate having to guess if applications want dd/mm/yy or mm/dd/yy. I don't even know what my locale says about dates right now. Don't trust the user's locale for anything other than timezones; odds are that it's not going to be 100% accurate and it's just going to make the user confused ("What kind of date do you want, again?").

This is one of the few cases where it's better to force the user to adapt instead of trying to make the program "user friendly."

Just pick one date format and stick with it. Use a reminder next to the field (something like yyyy-mm-dd) or use dropdowns/calendars if you must.

Name: 2 2008-06-12 20:24

>>10
How did you know I am the guy that RAGES when he is repeated?

Name: 10 2008-06-12 20:42

>>11
You might want to set up some iptables rules for your anus, then.

Name: Anonymous 2008-06-13 6:34

>>10
Use a sensible date format such as "1 March 2008", or "1st of March, 2008".[1]

http://chrisdone.com/requests-for-web-authors#H2.Useful-Date-Time

Name: Anonymous 2008-06-13 10:58

YYYYMMMMdddd

Name: Anonymous 2009-08-16 23:06

Lain.

Name: Sgt.Kabukiman㊺擤 2012-05-24 6:07

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Name: bampu pantsu 2012-05-29 3:49

bampu pantsu

Don't change these.
Name: Email:
Entire Thread Thread List