Code: Select all
put 300 into tTime --5 minutes
convert tTime from seconds to short time
put tTime --return "01:05" ?
Thanks
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
put 300 into tTime --5 minutes
convert tTime from seconds to short time
put tTime --return "01:05" ?
Code: Select all
convert the date to dateItems -- 'gregorian' Y,M,D,0,0,0 form (local time)
put tSeconds div 3600 into item 4 of it
put (tSeconds div 60) mod 60 into item 5 of it
put tSeconds mod 60 into item 6 of it
convert it from dateItems to short time
Code: Select all
function smptelite tSecs
return format("%02d:%02d:%02d", tSecs div 3600, (tSecs mod 3600) div 60, tSecs mod 60)
end smptelite
Code: Select all
put the seconds into tNow
convert tNow to dateitems
put tNow
Try:Finally, what is the spidier way to get, as a Dateitems, the local day and time?
Code: Select all
convert the seconds to dateItems
Code: Select all
convert the date && the long time to dateItems
put it into tDateTimeItems
Code: Select all
put the internet date into tDate2
convert tDate2 to dateItems
For what I understand (I have to do some testing, changing localization on the Mac, wich is a drag), in order to quickly obtain a DateItems that correctly reflects the Time in a device, not all the proposed solutions should work:@trevix: 'the seconds' is not a time of day measurement (i.e. on an arbitrary day since midnight) - it is a measure of point in time, i.e. the number of seconds since 1970-01-01 0:00 in UTC.
Code: Select all
convert the seconds to dateItems
Code: Select all
put the internet date into tDate2
convert tDate2 to dateItems
Code: Select all
convert the date && the long time to dateItems
put it into tDateTimeItems
Code: Select all
put the seconds into tNow
convert tNow to dateItems
Code: Select all
convert the seconds to dateItems
Code: Select all
convert the date && the long time to dateItems
Code: Select all
convert the date && the long time to seconds
convert it to dateItems