Re: Date-math fixes in Tiger
Re: Date-math fixes in Tiger
- Subject: Re: Date-math fixes in Tiger
- From: Nigel Garvey <email@hidden>
- Date: Mon, 16 May 2005 03:43:44 +0100
Tom Robinson wrote on Sat, 14 May 2005 11:33:09 +1200:
>And did you see the new properties?
>
>> The date class now has hours, minutes, and seconds properties. The
>> hours property always uses a 24-hour clock. [3516702]
>>
>> The month property of the date class can now be set to an integer.
>> [3525546]
>>
>> The weekday constants can now be coerced to numbers. Sunday is 1.
>> [3639194]
Looks good. It makes the date class seem more "complete" and should be
easier for newbies who have problems parsing the time - provided they're
writing for Tiger or later, of course.
For people who prefer weeks starting on Mondays, there's:
((myDate's weekday as integer) - 8) mod 7 + 7
... or:
(myDate - (date "Monday, 6 January 1000 00:00:00")) mod weeks div days
+ 1
... or even, I suppose:
item (myDate's weekday as integer) of {7, 1, 2, 3, 4, 5, 6}
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden