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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
root
Creator II
Creator II

TalendDate - TimeZone - Help

Hello, Hope everyone is safe and sound.

I need to read a String from DB (which is actually a date) and parse it as a date and use it further in my code.

<pre>

String tdate = "2020-08-14T08:59:34.961+05:30";

System.out.println("Date from DB: " + tdate);

Date tempDate = TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", tdate);

String tformatdt = TalendDate.formatDate("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", tempDate);

System.out.println(tformatdt);

</pre>

Output:

<pre>

Date from DB: 2020-08-14T08:59:34.961+05:30

2020-08-13T23:29:34.961-04:00

</pre>

If you see, when Talend Parses the date, it does not remember the original TimeZone.. It is changed from +05:30 to -04.00 (which is my local tz).

Any suggestions on how to maintain the original TimeZone of +05:30?

Thank you in advance.

Labels (6)
1 Reply
root
Creator II
Creator II
Author

Bump..

 

@Shicong Hong​