In Leopard, if you use the say command for the time and the time is written with a colon, the time will spoken using a 12-hour clock with the suffix. Try this in Leopard:
say "16:45"
However, if you use a space, the time will be spoken using a 24-hour clock.
I do not know why Apple did this but with such an easy go-around there’s no need to submit a bug report.
Model: MacBook
AppleScript: 2.2
Browser: Safari 523.10
Operating System: Mac OS X (10.5)
That’s interesting. Does it depend on the user’s Date and Time preferences? That is: are your own preferences set to use a twelve-hour clock? And if so, is the script’s effect different if you use a twenty-four hour clock instead?
tell application "Finder"
say (current date) as string
set temp to (current date)
set totalseconds to time of temp
set temphours to totalseconds div 3600
set tempminutes to (totalseconds - (temphours * 3600)) div 60
set tempseconds to totalseconds - (temphours * 3600) - (tempminutes * 60)
delay 3
--- 24 hour clock
set tempspeech to temphours & " " & tempminutes & " and" & tempseconds & " seconds" as string
say tempspeech
delay 3
--- 24 hour clock
set tempspeech to temphours & ":" & tempminutes & ":" & tempseconds as string
say tempspeech
delay 3
--- 12 hour clock
set AMorPM to "AM"
if temphours > 11 then
set temphours to temphours - 12
set AMorPM to "PM"
end if
if temphours = 0 then set temphours to 12
set tempspeech to temphours & " " & tempminutes & " and" & tempseconds & " seconds " & AMorPM as string
say tempspeech
end tell
Santa
Model: intel iMac
AppleScript: 2.1.1
Browser: Safari 3.0.4
Operating System: Mac OS X (10.5)
say (current date) as string
set temp to (current date)
set totalseconds to time of temp
set temphours to totalseconds div 3600
set tempminutes to (totalseconds - (temphours * 3600)) div 60
set tempseconds to totalseconds - (temphours * 3600) - (tempminutes * 60)
is the same as:
tell (current date) to set {temp, temphours, tempminutes, tempseconds} to {it as text, its hours, its minutes, its seconds}
say temp