Re: date syntax not working on 10.10.5?
Re: date syntax not working on 10.10.5?
- Subject: Re: date syntax not working on 10.10.5?
- From: Shane Stanley <email@hidden>
- Date: Wed, 19 Aug 2015 09:41:22 +1000
On 19 Aug 2015, at 6:42 am, Michael Grant <email@hidden> wrote:
>
> But Shane seems to think it may break at some point in the future, based on the Release Notes.
The fundamental problem is that creating a date from a string requires that the string matches particular format(s) (set in Preferences), and if it doesn't, any result is by definition a guess. And as the Cocoa documentation puts it: "If a formatter is set to be lenient, when parsing a string it uses heuristics to guess at the date which is intended. As with any guessing, it may get the result date wrong (that is, a date other than that which was intended)." Why take that risk when you don't have to? The differing results in this thread are surely a good argument for why creating dates from strings is best avoided where possible.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden