I have this bit of lua code
<script src="https://github.com/fengari-lua/fengari-web/releases/download/v0.1.0/fengari-web.js"></script>
<div>The local time in Ixnay is <span id="IxTime"></span></div>
<script type="application/lua">
local epoch = os.time{year=2014,day=1,month=1}
-- equation: x + y = 2016*365+182; x + z = 2024*365; z = y * 4
-- this assumes 4x rate past normal time
-- attempts to use 3x rate could not provide accurate results following timestamps
function conv(t)
local time = os.time(t)
local seconds_since_epoch = time - epoch
return seconds_since_epoch * 4 + epoch
end
js.global.document:querySelector("#IxTime").innerHTML = os.date(" %Y-%m-%d %H:%M:%S", conv(os.date('*t', os.time())))
</script>
Because of the limitations of lua, the Y2k38 bug prevents the time from going past 2038 before breaking. I don't know a lot about javascript but I know it has a more robust date/time mechanic. I've tinkered around with it for a bit but I'm running into two main problems:
I cannot figure out how to create the faster rate of time (time should move roughly 4x faster than IRL)
I can't seem to make the time start from my designated epoch time of 01/01/2014
any help would be great!