I need a script that will convert a date to julian date:
Today’s date is 05/29/2025. I need it in this format: 25149
I need a script that will convert a date to julian date:
Today’s date is 05/29/2025. I need it in this format: 25149
I ask this to Copilot in a browser:
In Javascript, how to convert today’s date into a julian date
and got this answer (modified the answer to fit Workflow consideration):
function getJulianDate()
{
var date = new Date()
var time = date.getTime(); // milliseconds since Unix epoch
var julianEpoch = 2440587.5; // Julian date at Unix epoch (Jan 1, 1970)
return time / 86400000 + julianEpoch; // 86400000 ms in a day
}
var todayJulianDate = getJulianDate();
Watch.log("Julian Date:"+todayJulianDate,1);
P.S. Skynet is coming!!!