Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Pulkit_Thukral
Partner - Creator II
Partner - Creator II

Masonic calendar to Standard Date Format

Hi,

I am fetching data from Oracle DB,where date fields are having values starting from '1/1/4000'.

How can we convert this to Standard Date Format 'DD/MM/YYYY hh:mm:ss TT'.

3 Replies
Chanty4u
MVP
MVP

try

Date(Date#(urDatefield,'D/M/YYYY'),'DD/MM/YYYY hh:mm:ss TT') AS newdate

Gysbert_Wassenaar

Date(AddYears(Floor(Date#(MasonicDate,'DD/MM/YYYY')),-2000),'DD/MM/YYYY hh:mm:ss TT') AS GregorianDate


If you want to keep the time parts then remove the floor() function from the above expression.


talk is cheap, supply exceeds demand
Pulkit_Thukral
Partner - Creator II
Partner - Creator II
Author

Thanks for the reply Gysbert,

Explanation of date field format :-

  • 1/1/4000 = 0 days

(1st octet is month, 2nd Octet is days and 3rd Octet is hours).

For eg: 000 8:22:13 (7 months, 21 days, 13 hrs)

This is required to be converted to standard format in minutes i.e(mm)