You are viewing limited content. For full access, please sign in.

Question

Question

Converting Julian Dates(edit: Ordinal Date) to Standard Dates

asked on February 11, 2014 Show version history

Julian Dates are a different way to display a date.  Instead of the standard date format "01/23/2014", a Julian date would be "14023".  The first two digits are the year where as the last 3 digits are the numbers of days into the year.  

Other examples:

14364 to 12/30/2014

14300 to 10/27/2014

14123 to 05/03/2014

 

The year would be simple enough to pattern match against.  However, are there any good ways to convert the last three digits into a month day format?  Thanks for all the help!

 

EDIT: A user pointed out that it was called Ordinal Date as opposed to Julian Date.  Thanks!

0 0

Answer

SELECTED ANSWER
replied on February 11, 2014

Thanks everybody for the posts!  I was able to figure a simple way to do it.  I just used Pattern Matching to separate out the last 3 digits and used the Date Token Calculator to add that many number of days - 1 to January 1st of that year.  

 

So:

14364: Jan 1 + 363 = 12/30/2014

14300: Jan 1 + 299 = 10/27/2014

14123: Jan 1 + 122 = 05/03/2014

1 0

Replies

replied on February 17, 2016 Show version history

Ended up having to convert a 6 digit Julian date (used in JDE) to a Gregorian date and thought I'd share my work. Basically followed the same steps as above depicting a 5 digit Julian date.

 

The workflow below takes an input (JulianValue) and converts it to a Gregorian Value by using regular expressions within the Date Token Calculator activity.

 

1 0
replied on February 11, 2014

eHow.com has an article on how to make the conversion (here). With those instructions it does not look like it would be too difficult using activities in Workflow to accomplish.

0 0
replied on February 11, 2014

Thanks for the reply, Blake!  I believe the article was referring to the Julian calendar.  So it was doing the conversion between Gregorian and Julian calendar.  It converted October 2, 1216 (Gregorian) to October 9, 1216 (Julian).  That's not quite exactly what I needed but thanks for the post!

0 0
replied on February 11, 2014

You'd be better off with a script than trying to do it with built-in activities. See this one for example.

0 0
replied on February 11, 2014 Show version history

You will likely want to separate out the values of the date, I suggest using the token editor with either the formatting or regular expression options and creating tokens of the date and the month and the julian date.

 

 

 

Use the information at the beginning of the eHow link Blake gave you to figure out the leap years.

 

EDIT: This image I created only accounts for calculating the amount of days that have passed in the year. You will need to combine your information with the year in order to get the date you wanted.

0 0
replied on February 11, 2014

Shelby,

 

The date format you are referring to is the 'Ordinal' date format (yyddd).  If you are looking for an easy way to tokenize this and many other date/time formats from a date/time value then please visit my website at www.qfiche.com.  On the Products page I have several custom workflow activities that I have developed.  One of the free ones is the 'Date Tokenizer'.  This custom workflow activity accepts any date/time value and generates tokens for just about any date/time format you can think of (including Ordinal Date and Julian Date.

 

The download link will provide a 30 day royalty free version of the Date Tokenizer custom workflow activity.  If the activity meets your needs then you can register and I will provide a key to unlock the full version.  (The activity is provided free in either case but registering it allows me to keep you updated on any new features.)

 

Let me know if you have any questions.

0 0
replied on February 11, 2014

Nice and simple!  If I had read your original post correctly I would have noticed that you wanted to convert an Ordinal date back into a calendar date and not vice-versa!  wink

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.