Re: Can't Coerce String to Date?
Re: Can't Coerce String to Date?
- Subject: Re: Can't Coerce String to Date?
- From: Yvan KOENIG <email@hidden>
- Date: Sat, 14 Mar 2015 15:54:02 +0100
Le 14/03/2015 à 12:59, Shane Stanley < email@hidden> a écrit :
On 14 Mar 2015, at 10:50 pm, Yvan KOENIG < email@hidden> wrote: As you may see, "12/31/1943" and "12/31-43" are correctly treated as invalid dates. What is puzzling is that "12 31/1943" and "12 31 1943" are not treated the same way. I don't see any logic behind these different behaviors.
It's assuming two numbers separated by a space represent a time, and then ignores the rest.
Thank's Shane
If AppleScript is able to identify something resembling a valid date, it deciphers it. set astring to "31 12-1943Yvan's birthday" date astring (*date "vendredi 31 décembre 1943 00:00:00"*) Good point, it wasn't a vendredi 13 ;).
If it doesn't, it try to decipher a time. set astring to "12 31-1943Yvan's birthday" date astring (*date "samedi 14 mars 2015 12:31:00"*)
This day is a good one, I learnt something.
Yvan KOENIG (VALLAURIS, France) samedi 14 mars 2015 15:50:05
|
_______________________________________________
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