Convert Julian Date to Gregorian Date

♀尐吖头ヾ 提交于 2019-12-04 08:18:51
furq

This answer shows the way to convert from a Unix timestamp to a Julian date. This is how you'd do it in Lua:

local julian = (os.time() / 86400) + 2440587.5
print(julian)
-- 2456496.1647338

And so this is how you'd convert in the other direction:

print( (julian - 2440587.5) * 86400) )
-- 1374508633

You can then convert this into a date and time using os.date().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!