Long Time format not including real seconds digits ? Solved :)

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
liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Long Time format not including real seconds digits ? Solved :)

Post by liveme » Tue Apr 13, 2021 3:06 am

HI ppl,
Running this code under Linux, I can not get the real seconds digits, it just round those to :00

4:02:00 PM

is there a way to get the real seconds 2 digits ?
thanks :

Code: Select all

  
   set UseSystemDate to false
   put time() into mytim
   convert mytim to long time
   answer mytim
   
*if set to "true", no time content is returned at all... :?:
Could my System Date not return seconds at all ?!! My Desktop clock does displays seconds fine right now.

Thanks
Last edited by liveme on Wed Apr 14, 2021 6:47 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Long Time format not including real seconds digits ?

Post by richmond62 » Tue Apr 13, 2021 9:50 am

Maybe I'm missing something, but I just did this:
-
SShot 2021-04-13 at 11.49.44.png
SShot 2021-04-13 at 11.49.44.png (12.4 KiB) Viewed 2239 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Long Time format not including real seconds digits ?

Post by FourthWorld » Tue Apr 13, 2021 9:59 am

"Time" does not include seconds, so converting it will not include anything more granular than minutes, because nothing more granular is in the string being converted.

Richmond's suggestion of "long time" should do what you need.

If your system will be used across multiple time zones you may consider storing time in "seconds" or "Internet date" to have time zone adjustments is handled automatically during format conversions.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm
Location: down under

Re: Long Time format not including real seconds digits ?

Post by liveme » Wed Apr 14, 2021 6:46 am

Thanks guys,
"put" worked out better than
"convert"...now showing seconds.

Also internet date might be very usefull next...will see !
Cool :wink:

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”