Re: date format
Re: date format
- Subject: Re: date format
- From: email@hidden
- Date: Tue, 27 Nov 2001 11:10:53 -0600
At 11:12 -0500 11/27/01, Marc K. Myers wrought:
>
> --Akua Sweets OSAX
>
> the clock using form "%d/%m/%y"
>
> -- "27/11/01"
>
>
Unfortunately, Akua Sweets would give you "09/03/01", which wouldn't
>
match "9/3/2001" on a string comparison. I don't know FMP, so I don't
>
know if that would work. You can extract the date elements without the
>
leading zeros (and with the century) using Akua Sweets with this rather
>
clumsy construction:
______________________________________________________________________
The date format osax is flexible and faster than Akua on my system:
----------------------------------------------------------------------
set d to date "Thursday, May 4, 1961 11:30:00"
format date d with format "%d/%m/%Y"
--> 04/05/1961
----------------------------------------------------------------------
The simplest method is to use Eric Grant's Sigma's Coercions. It has a coerce month to integer function. On my system this beats Emmanuel's Vanilla date function but only by the barest margin.
----------------------------------------------------------------------
set d to date "Thursday, May 4, 1961 11:30:00"
set dLim to "/"
tell d to {((its month) as integer), dLim, day, dLim, year}
set dateStr to "" & result
----------------------------------------------------------------------
Someone streamlined the FrenchVanillaDate function a bit - either Emmanuel himself or perhaps Nigel.
----------------------------------------------------------------------
set dLim to "/"
set curDate to (current date)
copy curDate to dateCnst
set dateCnst's month to January
set {dd, yyyy} to {text -2 thru -1 of ("0" & curDate's day), curDate's year}
set mm to text -2 thru -1 of ("0" & (1 + (curDate - dateCnst + 1314864) div 2629728))
set dStr to "" & {yyyy, dLim, mm, dLim, dd}
----------------------------------------------------------------------
Best Regards,
Christopher Stone
______________________________
StoneWorks Computer Consulting
email@hidden