Re: new (I think) time question
Re: new (I think) time question
- Subject: Re: new (I think) time question
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 7 Sep 2009 13:10:58 -0400
Subtracts 12, I hope you mean. :)
On 9/7/09, email@hidden <email@hidden> wrote:
>>> My machine doesn't get military time here regardless of the Date &
>>> Time settings.
>
> I get that, but someone else posted that the script didn't work for
> military time, so I added that to make it work in military time.
>
> But had a little boolean dislexia in the process. The script below now
> subtracts 13 if your mac is NOT set to military time and works on my
> mac.
>
> : }
>
> ES
>
> set AppleScript's text item delimiters to ""
> set wakeTime to "21:01"
> set oldDelims to AppleScript's text item delimiters
> set AppleScript's text item delimiters to {":", " "}
> set {wakeHour, wakeMin} to text items of wakeTime
> set AppleScript's text item delimiters to oldDelims
> set h to wakeHour as integer
> if h < 13 then
> set amOrPm to " am"
> else
> set amOrPm to " pm"
> set afterNoonTime to "1:00 pm"
> set t to (date afterNoonTime) as string
> display dialog t
> --> Sunday, September 6, 2009 1:00:00 PM
> if time string of date afterNoonTime does not contain "13" then set h
> to h - 12
> end if
> set m to wakeMin as integer
> if m < 10 then set m to "0" & m
> set wakeTime to (h & ":" & m & amOrPm)
> set WakeUpTime to short date string of (current date)
> set WakeUpTime to date (WakeUpTime & space & wakeTime)
> (time string of WakeUpTime)
> display dialog WakeUpTime as string
> --> Monday, September 7, 2009 9:01:00 PM
> return
>
>
--
Sent from my mobile device
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden