is that format convert-able outside LUA - or maybe I can change it to something easier to work with before it hits the saved variables.
-d
That depends on what you mean by "outside LUA". In Unix/Linux command line, you can use the date command: date -d '@1410642972'. In Python, there are modules time and datetime. Any sensible language has some library to work with unix timestamps.
I wonder what you mean by "something easier to work with". A timestamp is a single number with well-defined meaning, it's not susceptible to peculiarities like other date/time formats (timezone, DST). I think it's best to save timestamps, and only convert for display to users.
That depends on what you mean by "outside LUA". In Unix/Linux command line, you can use the date command: date -d '@1410642972'. In Python, there are modules time and datetime. Any sensible language has some library to work with unix timestamps.
I wonder what you mean by "something easier to work with". A timestamp is a single number with well-defined meaning, it's not susceptible to peculiarities like other date/time formats (timezone, DST). I think it's best to save timestamps, and only convert for display to users.
I didn't know it was Unix format - I can easily convert that in the VB.Net program I'm writing that uses the shopkeeper saved variables. In the VB.Net program I will probably convert it on the fly as I am reading all the values for each sale into a multi-dimensional array (sorted and displayed by the users selections).
I swear I did so many searches to find what format LUA was using - oddly enough I do this all the time with SQL exports to Excel. I should have just assumed.
Hope you don't mind if I hijack this thread, as I also have a question about timestamps that bothers me since a while ago and I haven't had the time to test it yet.
Does anyone know if these timestamps are server time (synced between users) or client time (dependent on the users local settings).
here are a few example:
1410642972
1410643006
1410643071
is that format convert-able outside LUA - or maybe I can change it to something easier to work with before it hits the saved variables.
As far as converting it before it hits the saved variables there are a few built in functions to allow you to manipulate timestamps, dates & times.
There may be more but I used these in an addon once and had a copy of this info I saved for reference.
If your client clock is desynced too much, you have trouble elsewhere.
Assuming your clock is synced via NTP, the values of GetTimeStamp() from server and client are not synchronous, but close to each other.