57 posts
Posted 07 April 2014 - 02:11 AM
Is there some webservice or something that I can use to get the current unix timestamp? Im making a program that reads/writes files that use these and I would like it to be at least somewhat accurate.
756 posts
Posted 07 April 2014 - 05:25 AM
I use
http://www.timeapi.org/utc/now?format=%25s to get the epoch for my programs ;)/>
Edited on 07 April 2014 - 03:25 AM
7508 posts
Location
Australia
Posted 07 April 2014 - 05:39 AM
It seems that you're after something more like a unique value, and since HTML interaction is not always enabled it is better to try and do something local, as such you can do the following.
local function getMinecraftTimestamp()
return string.format("%d:%d:%d", os.day(), os.time(), os.clock())
end
os.day — Minecraft day
os.time — Minecraft time
os.clock — time in seconds the computer has been running (this may not be the time the program has been running)
57 posts
Posted 07 April 2014 - 05:13 PM
I use
http://www.timeapi.o...now?format=%25s to get the epoch for my programs ;)/>
Thank you very much for this Anavrins this is perfect