Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Darmesh
Contributor III
Contributor III

Need to convert the date field in yyyy-MM-dd HH:mm:ss format

i have date in String format.

2022-04-01 17:08:35

when i converted it to date using parseDate

context.datetostr = TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",context.modified_date);

System.out.println(context.datetostr)

My Output is coming like this

strtodate :Fri Apr 01 17:08:35 IST 2022

I need output like this 2022-04-01 17:08:35 in date format

Labels (3)
3 Replies
gjeremy1617088143

hi @Darmesh Sureshbabu​ , have you set the date pattern you want in the output schema ?

Send me love and kudos

SMR040
Contributor III
Contributor III

Screenshots of your setup would help a lot...

 

You could also try with the TalendDate function. Something like this:

 

TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", context.modified_date)

HaroldSchmidt
Contributor
Contributor

Change your date format from dd/MM/yyyy to yyyy-MM-dd using the steps below: string date = DateTime "dd/MM/yyyy," ParseExact(SourceDate