Time function should return value in this format HH:MM:SS

Hi ,

I am using the Time function for setting the Start time and End Time.

When we run the script and check the start Time and end Time values it gives in this format HH:MM AM/PM

i.e
My Script is
set startTime to ""
set endTime to ""
put the time into startTime
log "Start Time is : " & startTime
Wait 30
put the time into endTime
log " End Time is : " & endTime


The result for this script is ,,,


Thu, 14/05/09 12:22:13 PM START Running t1.script
>>> 12:22:13 Start handler 1: t1
set startTime to ""
set endTime to ""
put the time into startTime
log "Start Time is : " & startTime
Thu, 14/05/09 12:22:13 PM log Start Time is : 12:22 PM
Wait 30
put the time into endTime
log " End Time is : " & endTime
Thu, 14/05/09 12:22:43 PM log End Time is : 12:22 PM

<<< 12:22:43 End handler 1: t1 (normal exit)
Thu, 14/05/09 12:22:43 PM SUCCESS Execution Time 0:00:30 t1.script



But iam expecting in terms of HH:MM:SS i.e with seconds and without AM/PM , it should look like the below one,

ie. Start Time is : 12:22:02 & End Time is : 12:22:32

can any one please help me out to achieve this.

Thanks in Advance

Comments

  • JonathanOSXJonathanOSX ForumAdmin admin
    The simplest solution is to use one of the convenient time modifiers. In this case you want the long time.
    put the long time into aTime 
    log "Time is : " & aTime
    
    You can also use the formattedTime() function to customize the output of any time value.

    For more details please consult the Working With Dates and Times Chapter in the SenseTalk Reference Manual.
Sign In or Register to comment.