FROM : Sean McBride
DATE : Mon Apr 11 16:34:35 2005
On 2005-04-08 20:16, Jack said:
>Why does NSDate's class method dateWithNaturalLanguageString: when given a
>string of type: "20050406". Return an invalid date of
>"-3468036-03-03T04:00:00Z"? Given a string it doesn't understand it should
>return nil, like it does for "NotADate".
I guess it thinks it does understand it.
>The worst part is it will write it
>out to a property list but then it won't understand it when trying to read
>it back, it quits reading the whole property list altogether. Is this
>something that should be a bug report
I'd say so.
>or just a matter of unorthodox users
>who refuse to use a decent readable date format?
Your example (20050406) is fairly readable to a human, but I can see it
confusing a computer. Don't blame the user that the computer is not
smart enough. The computer is giving the user the impression that it can
read like a human, but it is far from doing so, and so you get lots of
'user error'. Personally, I've found the 'date from natural string'
stuff fairly useless, so much so that I never use it. Here's another fun
example: "sep 3 2004" works, but "sept 3 2004" does not.
--
____________________________________________________________
Sean McBride, B. Eng <email_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
DATE : Mon Apr 11 16:34:35 2005
On 2005-04-08 20:16, Jack said:
>Why does NSDate's class method dateWithNaturalLanguageString: when given a
>string of type: "20050406". Return an invalid date of
>"-3468036-03-03T04:00:00Z"? Given a string it doesn't understand it should
>return nil, like it does for "NotADate".
I guess it thinks it does understand it.
>The worst part is it will write it
>out to a property list but then it won't understand it when trying to read
>it back, it quits reading the whole property list altogether. Is this
>something that should be a bug report
I'd say so.
>or just a matter of unorthodox users
>who refuse to use a decent readable date format?
Your example (20050406) is fairly readable to a human, but I can see it
confusing a computer. Don't blame the user that the computer is not
smart enough. The computer is giving the user the impression that it can
read like a human, but it is far from doing so, and so you get lots of
'user error'. Personally, I've found the 'date from natural string'
stuff fairly useless, so much so that I never use it. Here's another fun
example: "sep 3 2004" works, but "sept 3 2004" does not.
--
____________________________________________________________
Sean McBride, B. Eng <email_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
| Related mails | Author | Date |
|---|---|---|
| Jack | Apr 8, 20:16 | |
| Sean McBride | Apr 11, 16:34 |






Cocoa mail archive

