ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Timestamp (https://www.esoui.com/forums/showthread.php?t=1497)

Edda 05/14/14 02:02 AM

Timestamp
 
It seems to me ZO stripped the 'time' and 'os.time' functions from the Lua API. I've had no success at using them :(

So did anyone actually was able to get a proper timestamp ? If so how ? And I mean a real timestamp not GetGametimemilliseconds()

Harven 05/14/14 02:28 AM

Hey, maybe GetTimeStamp() will do it.

Edda 05/14/14 02:38 AM

Quote:

Originally Posted by Harven (Post 7721)
Hey, maybe GetTimeStamp() will do it.

Haha right =) Stupid me didn't check the API functions for a timestamp function :D

That should do it thanks !

Seerah 05/14/14 12:55 PM

I use ZO_FormatClockTime() to get the time in ZAM_Stats.

skyraker 05/14/14 03:13 PM

Quote:

Originally Posted by Edda (Post 7720)
'os.time'

Doesn't os.time take a table of date/time info and convert it to a timestamp? I thought GetTimeStamp() only returns the current time stamp?

Xrystal 05/14/14 03:28 PM

The downside of GetTimeStamp() is that you aren't easily able to get the date and time from it if you ever needed it. There is a date retrieval function for it but no equivalent time one.

Edda 05/15/14 04:35 AM

I guess I would have to store GetTimeString() separately.

Edda 05/15/14 06:33 AM

Quote:

Originally Posted by skyraker (Post 7776)
Doesn't os.time take a table of date/time info and convert it to a timestamp?

"The time function, when called without arguments, returns the current date and time, coded as a number" http://www.lua.org/pil/22.1.html

Quote:

Originally Posted by skyraker (Post 7776)
I thought GetTimeStamp() only returns the current time stamp?

Well, yes, this is what I need. What were you thinking about ? :)

Edda 05/15/14 06:34 AM

Quote:

Originally Posted by Seerah (Post 7769)
I use ZO_FormatClockTime() to get the time in ZAM_Stats.

Does this return microseconds as well ? Could use it.

skyraker 05/15/14 01:37 PM

Quote:

Originally Posted by Edda (Post 7798)
"The time function, when called without arguments, returns the current date and time, coded as a number" http://www.lua.org/pil/22.1.html


Well, yes, this is what I need. What were you thinking about ? :)

Ahh, I had misread the part about "if" you supply a table then there are mandatory values that have to be included.

The second quote goes with the first but was a more in-general question rather than specifically at you.

Edda 05/15/14 03:07 PM

No worries :rolleyes:

Now looking to format my Timestamp to human-readable :confused:

skyraker 05/15/14 03:27 PM

Quote:

Originally Posted by Edda (Post 7832)
No worries :rolleyes:

Now looking to format my Timestamp to human-readable :confused:

Are you looking to convert a timestamp back into date/time form? If so, that is what Xrystal was getting at. Game provides a function to get the date from a given time stamp, but the only time you can request from them is current time. I am going to assume that os.date doesn't work either if os.time doesn't.

In other words. Good luck! I'm guessing there are examples out in the world that do not use the os functions, just a pain in the rear to find.

Edda 05/16/14 01:53 AM

I tried GetDateStringFromTimestamp(integer timestamp) but it doesn't work - returns wrong vales. Gave up on displaying the date's timestamp anyways, was more like a little extra I wanted to add.


All times are GMT -6. The time now is 01:42 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI