• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: new (I think) time question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new (I think) time question


  • Subject: Re: new (I think) time question
  • From: Barry Wainwright <email@hidden>
  • Date: Sun, 06 Sep 2009 23:05:31 +0100


On 6 Sep 2009, at 22:56, Robert Poland wrote:


Try this;

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
display dialog h
-->21
if h < 13 then
set amOrPm to " am"
else
set amOrPm to " pm"
end if
set m to wakeMin as integer
if m < 10 then set m to "0" & m
set wakeTime to (h & ":" & m & amOrPm)
display dialog wakeTime as string
-->21:01 pm
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 AM 

NOTE this last is tomorrow.

I just tried it with time set to 24 hours, same thing.

What Time Zone /locale are you? I'm MST Zone, USA.

 
Bob Poland - Fort Collins, CO

I get:
--> 21
--> "21:01 pm"
--> "Sunday, 6 September 2009 21:01:00"

UK London timezone (GMT+1BST)

-- 
Barry


 _______________________________________________
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

  • Follow-Ups:
    • Re: new (I think) time question
      • From: "email@hidden" <email@hidden>
References: 
 >new (I think) time question (From: Robert Poland <email@hidden>)
 >Re: new (I think) time question (From: Yvan KOENIG <email@hidden>)
 >Re: new (I think) time question (From: Robert Poland <email@hidden>)
 >Re: new (I think) time question (From: Yvan KOENIG <email@hidden>)
 >Re: new (I think) time question (From: Deivy Marck Petrescu <email@hidden>)
 >Re: new (I think) time question (From: Robert Poland <email@hidden>)
 >Re: new (I think) time question (From: "email@hidden" <email@hidden>)
 >Re: new (I think) time question (From: Robert Poland <email@hidden>)
 >Re: new (I think) time question (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: new (I think) time question
  • Next by Date: Re: new (I think) time question
  • Previous by thread: Re: new (I think) time question
  • Next by thread: Re: new (I think) time question
  • Index(es):
    • Date
    • Thread