How to format 2 number yy values to 4 number yyy values in datetimes (19XX - 20XX)?
0
Hi Business Engineers, I am formatting date time with 2 numbers for years (yy) to 4 numbers (yyyy). When all the date times are of the 20th century, i add 1900 years, and I get a correct 4 numbers yyyy. But when the original date times are also from 21ths century ('17) how should I divide to add 1900 years or 2000 years in orde to complete '70 to 1970 or '17 to 2017? This solution worked for me: if $DataImport/DateTime !=empty and parseInteger(formatDateTimeUTC(trimToYearsUTC(parseDateTimeUTC($DataImport/DateTime,'dd/MM/yyyy')), 'yyyy'))<= 40 then addYearsUTC(parseDateTimeUTC($DataImport/DateTime,'dd/MM/yyyy'), 2000) else if $IteratorParticulier/geboortedatum !=empty and parseInteger(formatDateTimeUTC(trimToYearsUTC(parseDateTimeUTC($DataImport/DateTime,'dd/MM/yyyy')), 'yyyy'))> 40 then addYearsUTC(parseDateTimeUTC($DataImport/DateTime,'dd/MM/yyyy'), 1900) else empty