From Julian day to date - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: From Julian day to date (/showthread.php?tid=4283) |
From Julian day to date - emme - 04.10.2022 Ciao to all, I've made a small script that convert back the julian day to the specific date. Using the Code: local cDate = os.date('*t') you can get the cDate.yday that represent the julian day (counting 1 from Jan 1st) Apparentely there is no backformula that giving the year and the day, returns the complete date... Well, I've made it: Code: function j2d(yd, aaaa) this functin can be saved into the common user function and be called by: Code: local cDate, tDate = j2d(270, 2022) this will return the string for the date and the os.date('*t') table for the selected day... hope this would help you somehow ciao M |