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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
AlmendSR
Contributor
Contributor

Convert to Date 2017-09-06T23:10:25Z

I'm receiving a date string in the following format but I can't find a way to convert it using parseDate.  I've tried a bunch of different format strings.

 

TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",Var.var1) 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi, 

 

Just realized you had an example in the subject of your message.

 

The following seems to work, I removed the milleseconds from the format ('SSS') as they are not in your example date.

 

System.out.println(TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss'Z'","2017-09-06T23:10:25Z"));

Result : Wed Sep 06 23:10:25 CEST 2017

 

 

Hope this helps!

View solution in original post

4 Replies
Anonymous
Not applicable

Hi,

 

Can you post some examples of date strings you're receiving? Then i'll give it a go here.

Where are you receiving them from?

 

Anonymous
Not applicable

Hi, 

 

Just realized you had an example in the subject of your message.

 

The following seems to work, I removed the milleseconds from the format ('SSS') as they are not in your example date.

 

System.out.println(TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss'Z'","2017-09-06T23:10:25Z"));

Result : Wed Sep 06 23:10:25 CEST 2017

 

 

Hope this helps!

shivanand
Contributor III
Contributor III

Try this 

TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",Var.var1)

AlmendSR
Contributor
Contributor
Author

That did it! thank you.