Re: Re: date format
Re: Re: date format
- Subject: Re: Re: date format
- From: email@hidden
- Date: Wed, 28 Nov 2001 00:07:34 EST
In a message dated 11/27/01 11:58:45 AM, Jean-Marie Hoornaert wrote:
>
Here a script write by Jeff Baumann.
Actually, the bulk of this code came from this list (maybe from Nigel and
Emmanuel? Not sure.) I can't take full credit for it, but it is fast, stable,
osax-free, and battle tested in several mission critical production
environments.
>
It returns the current date in a 2001.11.26 format, but it's
>
really easy to modify:
FYI, the reason I use this format is so that the files/folders line up
correctly in Finder list views when I view by name.
>
on frenchVanillaDottedDate()
>
set fullMonth to 2629728 -- 730.48 * 60 * 60
>
set halfMonth to fullMonth div 2 -- 1314864
>
set currDate to (current date)
>
copy currDate to janDate
>
set the month of janDate to January
>
set monthNum to (1 + (currDate - janDate + halfMonth) div fullMonth)
>
set mo to text -2 thru -1 of (("0" & monthNum) as string)
>
set da to text -2 thru -1 of ("0" & (day of currDate as string))
>
return ((year of currDate) & "." & mo & "." & da) as string
>
end frenchVanillaDottedDate
From the sad but true department, here are some speed tests on the
frenchVanillaDottedDate handler:
lower numbers are faster, all machines have gobs of RAM
Powerbook G3 500MHz MacOS 9.1 (with 21 apps running)..........12
G4 400MHz
OSX 10.1.1 (no other
apps).................................................................11
in the Classic (9.2.1)
environment........................................44
Mac OS 9.2.1 (running natively, no other apps)........................18
G3 350 MHz iMac MacOS 9.1
(running a busy WebSTAR 4.4 + multiple AS CGIs).................16
Dual G4 500 MHz, MacOS X 10.1.1
(running only W*V, no
traffic).........................................................35
PowerPC 601 (7200/90) MacOS 9.1 (running QDNS+SIMS).......260
In summary, MacOS 9.1 on a 350MHz G3 under load is more than twice as fast as
MacOSX 10.1.1 on a dual 500MHz G4 under no load.
Which hates Applescript more - the G4, MacOS 9.2.1, or OSX?
Jeff Baumann
email@hidden
www.linkedresources.com
>
--
>
French is my first language, Dutch my second and ...
>
AppleScript my third.
>
>
Cordialement (cordially)
>
____________________
>
Jean-Marie -HOO;-)
>
____________________
>
Jean-Marie Hoornaert
>
email@hidden
>
http://www.h2o.be
>
AppleScripting FileMaker
>
French web site