System time including tenths of a second

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

System time including tenths of a second

Post by phaworth » Sat Aug 14, 2010 11:23 pm

Running on OSX and want to get the current time including tenths of a second. The OSX Date & Time system setting allows me to define a time format that includes tenths of a second so I did that for the Long format but if I "put the long system time" in the message box, I only see hours, minutes, and seconds, no tenths.

Anyone know how I can get the tenths of a second to show up?

Thanks,
Pete

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: System time including tenths of a second

Post by bn » Sat Aug 14, 2010 11:45 pm

Pete,
the only way I found is:

Code: Select all

on mouseUp
   put the milliseconds into tmSec
   put char 1 to -4 of tmSec into tSec
   convert tSec from seconds to  long system time
   -- convert tSec from seconds to  long time
   put ":" & char -3 of tmSec after word 1 of tSec
   put tSec
end mouseUp
maybe there are other ways
regards
Bernd

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Re: System time including tenths of a second

Post by phaworth » Tue Aug 17, 2010 11:44 pm

Thanks Bernd, that should work fine. Hadn't found the milliseconds function!
Pete

Post Reply