Translate Julian date to local date

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

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

Post Reply
timle
Pro Scripter
Posts: 96
Joined: Tue Apr 20, 2004 5:53 am

Translate Julian date to local date

Post by 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.

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Translate Julian date to local date

Post by 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?

timle
Pro Scripter
Posts: 96
Joined: Tue Apr 20, 2004 5:53 am

Re: Translate Julian date to local date

Post by 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

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Translate Julian date to local date

Post by 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

timle
Pro Scripter
Posts: 96
Joined: Tue Apr 20, 2004 5:53 am

Re: Translate Julian date to local date

Post by 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

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Translate Julian date to local date

Post by 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

timle
Pro Scripter
Posts: 96
Joined: Tue Apr 20, 2004 5:53 am

Re: Translate Julian date to local date

Post by timle » Tue Sep 05, 2017 4:01 pm

Awsome thank you

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts