Time manipulation
Time manipulation
- Subject: Time manipulation
- From: Robert Poland <email@hidden>
- Date: Tue, 5 Jun 2001 18:02:52 -0400
The recent flurry of talk about Time manipulation inspired (and
helped) me to create the following part of my startup script. 12 Hour
clock is assumed.
<Start>
set vDate to (current date)
set timeStr to "" & time string of (vDate)
set text item delimiters to {" "}
set ampm to last text item of timeStr
set text item delimiters to {""}
set timeStr to ((characters 1 thru ((the length of timeStr) - 6) of
timeStr)) as text
set timeStr to timeStr & " " & ampm
set DateString to "" & (vDate) -- month, day, year, time, AM/PM
set the_hourofday to "" & (get word 5 of DateString) as text
set DateString to "" & (vDate)'s month & " " & (vDate)'s day & ", "
& (vDate)'s year -- month, day, year
if ampm = "AM" or ampm = "am" then
ampm = "AE M" -- make it speakable
say "Good morning Robert. It is " & timeStr & ", " & DateString
using "Fred" --Morning
else if the_hourofday is less than 6 then
say "Good afternoon Robert. It is " & timeStr & ", " &
DateString using "Fred" -- afternoon
else
say "Good evening Robert. It is " & timeStr & ", " & DateString
using "Fred" -- evening
end if
<End>
Comments?
--
-
Bob Poland
email@hidden
Check out my garage sale
http://www.ibrb.org/