Re: Getting the time of day
Re: Getting the time of day
- Subject: Re: Getting the time of day
- From: Steve Roy <email@hidden>
- Date: Wed, 24 Sep 2003 10:47:40 -0400
Lyle Petro <email@hidden> wrote:
>
I would like to be able to determine the time of day via AppleScript. Am I
>
missing something simple, or is a little mathematical magic involved?
You can get 'time of (current date)', which will give you the number of seconds
since the beginning of the day. From there, you can use whatever calculations
you need.
set theSeconds to time of (current date)
set theHours to round (theSeconds / (60 * 60)) rounding down
set theSeconds to theSeconds mod (60 * 60)
set theMinutes to round (theSeconds / 60) rounding down
set theSeconds to theSeconds mod 60
"" & theHours & ":" & theMinutes & ":" & theSeconds
--> "10:47:16"
Steve
--
Steve Roy <email@hidden>
Personal homepage: <
http://homepage.mac.com/sroy>
Projects homepage: <
http://www.roydesign.net>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.