Thread Tools Display Modes
05/14/14, 02:02 AM   #1
Edda
 
Edda's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
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()
  Reply With Quote
05/14/14, 02:28 AM   #2
Harven
 
Harven's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 135
Hey, maybe GetTimeStamp() will do it.
  Reply With Quote
05/14/14, 02:38 AM   #3
Edda
 
Edda's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
Originally Posted by Harven View Post
Hey, maybe GetTimeStamp() will do it.
Haha right =) Stupid me didn't check the API functions for a timestamp function

That should do it thanks !
  Reply With Quote
05/14/14, 12:55 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
I use ZO_FormatClockTime() to get the time in ZAM_Stats.
  Reply With Quote
05/14/14, 03:13 PM   #5
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
Originally Posted by Edda View Post
'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?
  Reply With Quote
05/14/14, 03:28 PM   #6
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
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.
  Reply With Quote
05/15/14, 04:35 AM   #7
Edda
 
Edda's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
I guess I would have to store GetTimeString() separately.
  Reply With Quote
05/15/14, 06:33 AM   #8
Edda
 
Edda's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
Originally Posted by skyraker View Post
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

Originally Posted by skyraker View Post
I thought GetTimeStamp() only returns the current time stamp?
Well, yes, this is what I need. What were you thinking about ?
  Reply With Quote
05/15/14, 06:34 AM   #9
Edda
 
Edda's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
Originally Posted by Seerah View Post
I use ZO_FormatClockTime() to get the time in ZAM_Stats.
Does this return microseconds as well ? Could use it.
  Reply With Quote
05/15/14, 01:37 PM   #10
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
Originally Posted by Edda View Post
"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.
  Reply With Quote
05/15/14, 03:07 PM   #11
Edda
 
Edda's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
No worries

Now looking to format my Timestamp to human-readable
  Reply With Quote
05/15/14, 03:27 PM   #12
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
Originally Posted by Edda View Post
No worries

Now looking to format my Timestamp to human-readable
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.
  Reply With Quote
05/16/14, 01:53 AM   #13
Edda
 
Edda's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
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.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Timestamp


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off