• 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: Current hour and minute
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Current hour and minute


  • Subject: Re: Current hour and minute
  • From: Nigel Garvey <email@hidden>
  • Date: Fri, 2 Feb 2001 01:24:51 +0000

Bill Briggs wrote on Thu, 1 Feb 2001 19:59:04 -0300:

>At 12:06 AM +0100 02/02/01, Emmanuel wrote:
>>At 20:39 +0100 1/02/01, Bill Briggs wrote:
>>>>time to text and in the
>>>>format (HH:MM am/pm)
>>>
>> >text -1 through -11 of ((current date) as text)
>>
>>------------------
>> -- "001 0:05:24"
>>------------------
>>
>>hmmm.
>
>I get
>--> " 7:53:23 PM"
>
>but you're using a 24 hour clock, and in that system am/pm are irrelevant.

time string of (current date)

... is more efficient for that result *and* works with any Date & Time
setting.

>Of course it depends on what format you have set in the Date & Time
>Control Panel. If this is something that he wants to be portable,
>then he'll have to take a different approach. If he's using it on his
>own system, then he can use it directly or adapt it.

That's right. If Tod's own settings are for a 12-hour display with colon
separators, this gets what he wants:

tell time string of (current date) to get text 1 thru word 2 & " " &
word -1

Otherwise, he's looking at something like:

set t to time of (current date)
set hr to text -2 thru -1 of ("0" & t div hours)
set min to text -2 thru -1 of ("0" & t mod hours div minutes)
if hr < 12 then
set period to " am"
else
set period to " pm"
end if
hr & ":" & min & period

NG


  • Prev by Date: Re: Current hour and minute
  • Next by Date: Re: Can a script create an applet?
  • Previous by thread: Re: Current hour and minute
  • Next by thread: Re: Current hour and minute
  • Index(es):
    • Date
    • Thread