Re: Date/time weirdness
Re: Date/time weirdness
- Subject: Re: Date/time weirdness
- From: Nigel Smith <email@hidden>
- Date: Thu, 29 Jul 2004 16:59:47 +0100
On 29/7/04 15:42, "Michelle Steiner" <email@hidden> wrote:
>
Exactly what is going on here?
>
>
set foo to "16/15/14"
>
date foo
>
>
--> date "Thursday, July 29, 2004 4:15:14 PM"
>
>
The minutes and seconds correspond to the last two integers expressed
>
in the string. The hours vary with the first integer, but I can't
>
figure out the exact relationship. The date is the current date.
16 in the 24-hour clock = 4PM in the 12 hour clock.
Looks like it is treating your string as just the time in hours, minutes and
seconds and defaulting to the current date for the rest, since it is unable
to make a valid date from the string (no valid month value).
On my machine -- set to UK dd/mm/yy format -- setting the second value to 12
or less results in a date as expected:
set foo to "16/12/14"
date foo
--> date "Tuesday, December 16, 2014 0:00:00"
...and any non-valid month value (but still a valid time) gets a similar
result to yours:
set foo to "16/0/14"
date foo
--> date "Thursday, July 29, 2004 16:00:14"
...while:
set foo to "25/13/14"
date foo
--> "Invalid date and time 25/13/14."
HTH,
Nigel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.