IP – generate the Julian Date (simple)

This formula for InfoPath calculates the number of days in a calendar year. (1.1. = 1 – 31.12. = 365)

Generates todays Julian Date in a field in InfoPath: (based on the beginning of that year)

(number(substring(today(), 9, 2)) + floor((153 * (number(substring(today(), 6, 2)) + 12 * (floor((14 – number(substring(today(), 6, 2))) / 12)) – 3) + 2) / 5) + (number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(substring(today(), 6, 2))) / 12))) * 365 + floor((number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(substring(today(), 6, 2))) / 12))) / 4) – floor((number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(substring(today(), 6, 2))) / 12))) / 100) + floor((number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(substring(today(), 6, 2))) / 12))) / 400) – 32045) – (number(1) + floor((153 * (number(1) + 12 * (floor((14 – number(1)) / 12)) – 3) + 2) / 5) + (number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(1)) / 12))) * 365 + floor((number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(1)) / 12))) / 4) – floor((number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(1)) / 12))) / 100) + floor((number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(1)) / 12))) / 400) – 32045)+1

By a selected Date:  (change “Date” field in the formula to the corresponding date field in the InfoPath form)

(number(substring(Date, 9, 2)) + floor((153 * (number(substring(Date, 6, 2)) + 12 * (floor((14 – number(substring(Date, 6, 2))) / 12)) – 3) + 2) / 5) + (number(substring(Date, 1, 4)) + 4800 – (floor((14 – number(substring(Date, 6, 2))) / 12))) * 365 + floor((number(substring(Date, 1, 4)) + 4800 – (floor((14 – number(substring(Date, 6, 2))) / 12))) / 4) – floor((number(substring(Date, 1, 4)) + 4800 – (floor((14 – number(substring(Date, 6, 2))) / 12))) / 100) + floor((number(substring(Date, 1, 4)) + 4800 – (floor((14 – number(substring(Date, 6, 2))) / 12))) / 400) – 32045) – (number(1) + floor((153 * (number(1) + 12 * (floor((14 – number(1)) / 12)) – 3) + 2) / 5) + (number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(1)) / 12))) * 365 + floor((number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(1)) / 12))) / 4) – floor((number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(1)) / 12))) / 100) + floor((number(substring(today(), 1, 4)) + 4800 – (floor((14 – number(1)) / 12))) / 400) – 32045) + 1

Explanation:
substring(date, 9, 2) is the day
substring(date, 6, 2) is the month
substring(date, 1, 4) is the year

Is this Pages usefull? Usefull Useless 0 of 0 people say this Pages is usefull.