Re: Arcane date smarts (Was: Getting a folder based on creation
Re: Arcane date smarts (Was: Getting a folder based on creation
- Subject: Re: Arcane date smarts (Was: Getting a folder based on creation
- From: Richard Morton <email@hidden>
- Date: Fri, 2 Nov 2001 10:19:23 +1100
Nigel Garvey's message of 1/11/01 11:25 AM contained:
>
>I wondered if that would catch your attention Nigel. :-}
>
>
Richard! Where have you been? :-)
:-D Looking for my towel. Don't suppose you've seen it anywhere?
>
>>By the way, it's still about five times as fast to set midnight of the
>
>>current date in the conventional way...
>
>
>
>Or if you want it really fast - without any call to 'current date':
>
>
>
>set firstMoment to "12AM"
>
>set today to date firstMoment
>
>--> date "Thursday, 1 November 2001 12:00:00 AM"
>
>
>
> Any less info than "12AM" and it takes the number as being the day.
>
>
We-e-ll, I still reckon my way has the edge...
And you would have good reason for this, seeing as you tested and I
didn't! <slap> One has to get up very early in the morning to catch
you...
>
...but there's not much in it.
You're too kind as usual: it's more than 20% faster. <sigh> No doubt
we're helping people save lots of time here. ;-}
>
But hey! Have you tried date "0"?
Not until you mentioned it. I guess it would call the same function as
date "12 AM", but it's ever so slightly faster:
set firstMoment to "12 AM"
set today to date firstMoment
--> sessionAvg:0.08521
set firstMoment to "0"
set today to date firstMoment
--> sessionAvg:0.08141
set today to (current date)
set today's time to 0
--> sessionAvg:0.06761
You win! ;-P
Cheers,
Richard
-- Test early, test often, and never lose sight of your towel