-   Tutorials & Other Helpful Info (
-   -   CountDown with TimeStamps convert to TimeString (

Baumkuchen3 03/06/19 08:57 AM

CountDown with TimeStamps convert to TimeString
Hi, i cant figure it out... i just want to show a CountDown in (hh:mm:ss) a Label.

This piece of code calculates the the time till the future time is now.

local timeRemainingSecs =  GetDiffBetweenTimeStamps(timeInFuture , GetTimeStamp())
So how can i convert the result to a nice looking Time string? I found this but it doesnt really work ... could I get a Example for a CountDown?

It would be perfect when the string would be with leading zeros --> e.g. 12:03:07 (not 12:3:7)


Drummerx04 03/06/19 04:35 PM

You are probably looking for:
Lua Code:
  1."%X", timestamp) -- returns formatted time string

I'm pretty sure if you plug in a timestamp difference, you'll still get what you are looking for. You can read more about it here.

There are ways to explicitly format different aspects of the string (%X is a standard time format)

All times are GMT -6. The time now is 10:02 PM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2014 - 2020 MMOUI