/    Sign up×
Community /Pin to ProfileBookmark

Ordinal (Julian) YYYYDDD to True Julian 2450000.0

Does anyone have a script to convert the day of year ordinal date format YYYYDDD to the true Julian date (number of days since noon jan 1 4713 BC.

Time extensions are not necessary

Thanks in advance
Larry

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Jan 10.2007 — Search

JavaScript Julian date

on Google and you should get results.

Eric
Copy linkTweet thisAlerts:
@AgilysysLarryauthorJan 10.2007 — Been there done that. No such luck on Google. Everyother converter, and mostly from mmddyy type dates to Julian.
Copy linkTweet thisAlerts:
@mrhooJan 10.2007 — Sorry- please delete this, moderator
Copy linkTweet thisAlerts:
@felgallJan 11.2007 — That's a huge amount of code to do something so simple. Here's a shorter version.

Date.prototype.getJulian = function() {
return Math.floor((this / 86400000) -
(this.getTimezoneOffset()/60000) + 2440587.5);
}
var [b]julianDay[/b]=new Date([b]year[/b],0,[b]day[/b]).getJulian();


just substitute the year and day from the julian dddyyyy in as year and day and the correct julian day will be returned in julianDay.
Copy linkTweet thisAlerts:
@mrhooJan 11.2007 — Sorry- please delete this, moderator!
Copy linkTweet thisAlerts:
@felgallJan 11.2007 — deleted
Copy linkTweet thisAlerts:
@AgilysysLarryauthorJan 11.2007 — Thanks everyone. I got it. We convereted the date server side to true Julian from the mmddyyyy and sent it to the page.

I really tried to avoid that church debate with what I thought was a well phrased question about a conversion utility. :-/
×

Success!

Help @AgilysysLarry spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...