Anyone know an easy way to caculate Julian Days in a Workflow

  • 7 December 2016
  • 2 replies
  • 8 views

Badge +9

This seems to be a function that should be in a date library. I've been a programmer for 40 years and have worked with Julian Dates since 1977.

Does anyone know a quick way to find the day of the year?


2 replies

Badge +11

How about it as a calculated column- 

To get the number for the day of the year:

=ROUNDDOWN(<YourDate>-DATE(YEAR(<YourDate>),1,0),0)

Then append the year to it to get the Julian format.

=TEXT(<yourDate>,"YYYY")&ROUNDDOWN(<YourDate>-DATE(YEAR(<YourDate>),1,0),0)

Badge +9

That won't work for what I need. I had to roll my own.

First I setup a variable for today. Next I set it to Today at Runtime.

Then I did two convert values: First) To use the year to get the Date of the Start of the year basically "01-01-yyyy

Payload Commanding

fn-FormatDate(fn-Substring(01-01,3,2)/fn-Substring(01-01,0,2)/fn-FormatDate(DateToday,yyyy), dd-MM-yyyy)

Second I calculate the Day Difference between Today and the First of the Year 

Payload Commanding

fn-Abs(fn-DateDiffDays(DateofBeginofYear,DateToday))

Finally I add 1 to it to take todays date into count.

196313_pastedImage_1.png

Reply