Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Vivi2
Contributor III
Contributor III

Date conversion "dd/MM/yy"

Hello,

while I am trying to integrate date with format "dd/mm/YY" like 24/05/30 (from file) I have 24/05/2030 in postgresql database. It should be 24/05/1930

Note that in tmap I am doing conversion :

row1.Date_de_Naissance == null || ? null:TalendDate.parseDate("dd/MM/yy",row1.Date_de_Naissance) 

0695b00000Ux2ceAAB.png 

How to do please?

Thanks

Labels (3)
3 Replies
Anonymous
Not applicable

Hi

The function thinks it is the current century, try this expresssion.

 

row1.Date_de_Naissance == null || ? null:TalendDate.parseDate("dd/MM/yyyy",row1.Date_de_Naissance.substring(0,row1.Date_de_Naissance.lastIndexOf("/")+1)+"19"+row1.Date_de_Naissance.substring(row1.Date_de_Naissance.lastIndexOf("/")+1)) 

and set the date pattern as "dd/MM/yyyy" of Date_de_Naiss column in out1 table.

Regards

Shong

Vivi2
Contributor III
Contributor III
Author

Thanks for your reply .

But how if in the same file i have 15/11/19. It should be 15/11/2019 not 15/11/1919.

Anonymous
Not applicable

What's the logic here? If yy is greater than the current year(22), it is 19yy, otherwise, it should be 20yy?