Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <script src="https://github.com/fengari-lua/fengari-web/releases/download/v0.1.0/fengari-web.js"></script>
  2.  
  3. <Center><div>The local time in Ixnay is <span id="IxTime"></span></div></Center>
  4. <script type="application/lua">
  5. local epoch = os.time{year=2014,day=1,month=1}
  6. -- equation: x + y = 2016*365+182; x + z = 2024*365; z = y * 4
  7. -- this assumes 4x rate past normal time
  8. -- attempts to use 3x rate could not provide accurate results following timestamps
  9.  
  10. function conv(t)
  11. local time = os.time(t)
  12. local seconds_since_epoch = time - epoch
  13. return seconds_since_epoch * 4 + epoch
  14. end
  15.  
  16. js.global.document:querySelector("#IxTime").innerHTML = os.date(" %Y-%m-%d %H:%M:%S", conv(os.date('*t', os.time())))
  17.  
  18. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement