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: 
ankit7359
Creator II
Creator II

Date/Time conversions in TMap?????

Hi,

I am trying to convert String(Date in String) to Date.

 and the vice - versa.

Also when i am using TalendDate functions/Routines in Tmap - TalendDate.formatDate() for conversion of Date to String... i m not able to get it ....

While the same thing happens if i use TalendDate.parseDate() for conversion of String to Date...

The input date as String is "02/01/1996 05:09:00"

trowgenerator----> tmap------>tlogrow..

Pls help...

Thanks in advance,

Ankit

 

Labels (2)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@ankit7359,still do you have issue? if not please,please mark a solution,so that it will be helpful to others. 

View solution in original post

5 Replies
manodwhb
Champion II
Champion II

@ankit7359,when you convert string to date the below expressions will work that you should specify the correct date format.

stringtodate

TalendDate.parseDate("dd/MM/yyyy HH:mm:ss", row3.newColumn)

date to sting 

TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", row3.col) 

ankit7359
Creator II
Creator II
Author

hi @manodwhb,

Thanks for your response...

What if you have a use - case that String Date should be converted to String Date format...??

I know it quite silly, but can it be possible.. for example. 

"02/01/1996" -> "1996/02/01"

Also,on the other post of Tmap understanding issue.....

i was able to get some idea on Inner Join and its reject.. But do you have any other link for Match model and other properties for Tmap...

I wasnt able to get clear understanding on those properties.

Can you pls help me in this regard...

Thanks,

Ankit

SachinD
Creator
Creator

 

convert date to string 

TalendDate.formatDate("yyyy-MM-dd",row1.DATE) 

 

convert string to date

TalendDate.parseDate( "yyyy-MM-dd",row1.DATE)  

manodwhb
Champion II
Champion II

@ankit7359,use the below way.that which will convert the date format.

 

TalendDate.parseDate("yyyy/MM/dd",TalendDate.formatDate("dd/MM/yyyy",row3.newColumn))

manodwhb
Champion II
Champion II

@ankit7359,still do you have issue? if not please,please mark a solution,so that it will be helpful to others.