Re: A few questions about dates
Re: A few questions about dates
- Subject: Re: A few questions about dates
- From: Sweth Chandramouli <email@hidden>
- Date: Sun, 27 Aug 2006 10:25:20 -0400
- Mail-followup-to: Applescript Users <email@hidden>
On Saturday, 26 August 2006 at 20:39:18 EDT,
Mat (<email@hidden>) wrote:
> [1]http://developer.apple.com/documentation/applescript/Conceptual/App
> leScriptLangGuide/AppleScript.2d.html
> " set theDate to current date --using scripting addition command
> --result: date "Saturday, February 27, 1999 3:37:50 PM"
> weekday of theDate --result: Saturday
> day of theDate --result: 27
> month of theDate --result: February
> year of theDate --result: 1999
> time of theDate --result: 56270 (seconds since 12:00:00 AM)
> time string of theDate --result: "3:37:50 PM"
> date string of theDate --result: "Saturday, February 27, 1999""
None of these are the actual value of the date in seconds, though.
FWIW, in the end, I decided to punt on using AppleScript for my current
problem, and figured out how to use Glue::Mac w/ Perl (my lang of
choice); once I did that, I was able to fetch the date value directly,
and confirm that it does, in fact, use Unix epoch seconds for dates
(at least under 10.4.7, but I'd imagine that it's been the case since
OS X was rolled out).
Also, it turns out that I was just being mildly tarded about that
"today"--I was looking at a bunch of older scripts that I had written,
and kept seeing "today" used in comparisons, but couldn't get it to work
in the script that I was working on last night; then I noticed that in
all of those older scripts, I had a "set today to current date" at the
top.
(It's really amazing how much easier scripting the Mac is when you can
do it in a language that makes sense (by which I mean "a language that you
already know"). :) )
-- Sweth.
--
Sweth Chandramouli
email@hidden - http://EthicalHomes.com/
Need to sell your home in a fixed timeframe? As a Certified Auction
Specialist, I'd be glad to talk to you about how adding an auction
listing to your marketing efforts can ensure your home gets sold on
your schedule while still getting you market value.
_______________________________________________
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