Translate Julian date to local date

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: JRL, Dorian (MJT support), Rain, Phil Pendlebury

Translate Julian date to local date

Postby timle » Thu Aug 31, 2017 9:34 pm

hello,
would someone show me how to translate Julian date to local date

231 = 0819

thank you
Last edited by timle on Mon Sep 04, 2017 3:20 am, edited 1 time in total.
timle
Pro Scripter
 
Posts: 89
Joined: Tue Apr 20, 2004 5:53 am

Re: Translate Julian date to local date

Postby JRL » Sun Sep 03, 2017 5:03 am

I don't have an answer but it would be helpful to know how you define Julian date. I believe that officially it is a number where 0 represents noon on January 1, 4713 BC. In looking this up it seems it has been redefined in several other ways Explained HERE. How are you defining Julian date?
User avatar
JRL
Automation Wizard
 
Posts: 3193
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Translate Julian date to local date

Postby timle » Mon Sep 04, 2017 3:13 am

my mistake when giving you the example. I have corrected it, it should be like below

231 corresponds to 231st day of the year which is August 19th
timle
Pro Scripter
 
Posts: 89
Joined: Tue Apr 20, 2004 5:53 am

Re: Translate Julian date to local date

Postby JRL » Tue Sep 05, 2017 4:35 am

For that you could use vbscript datediff.

Code: Select all
Year>yyyy
sub>yyyy,1
VBEval>datediff("d","12/31/%yyyy%",(now)),res
MDL>res
User avatar
JRL
Automation Wizard
 
Posts: 3193
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Translate Julian date to local date

Postby timle » Tue Sep 05, 2017 6:57 am

This change from local date to Julian date. how can you convert from Julian to local

thank you
timle
Pro Scripter
 
Posts: 89
Joined: Tue Apr 20, 2004 5:53 am

Re: Translate Julian date to local date

Postby JRL » Tue Sep 05, 2017 12:55 pm

Oops. Try this instead.

Code: Select all
Let>vDays=231

Year>yyyy
VBEval>datediff("d","12/31/1899","01/01/%yyyy%"),res
Add>res,%vDays%
VBEval>FormatDateTime(%res%,0),vResDate

MDL>vResDate
User avatar
JRL
Automation Wizard
 
Posts: 3193
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Translate Julian date to local date

Postby timle » Tue Sep 05, 2017 4:01 pm

Awsome thank you
timle
Pro Scripter
 
Posts: 89
Joined: Tue Apr 20, 2004 5:53 am


Return to Scripts and Tips

Who is online

Users browsing this forum: No registered users and 1 guest