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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
talendtester
Creator III
Creator III

[resolved] TalendDate.parseDate is adding 1 extra hour on DST start times

I think when you attempt to convert a string date timestamp using TalendDate.parseDate 1 extra hour is being added to DST start times.
The conversion works correctly for DST end times.
My job looks like:
tFileInputExcel > tMap > LogRow
On tFileInputExcel column DST_START is a String data type.
On tMap column DST_START is Date.
TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",row1.DST_START)
In my Excel I put the following:
DST_START
2000-04-02 02:00:00
2001-04-01 02:00:00
2002-04-07 02:00:00
2003-04-06 02:00:00
2004-04-04 02:00:00
2005-04-03 02:00:00
2006-04-02 02:00:00
2007-03-11 02:00:00
2008-03-09 02:00:00
2009-03-08 02:00:00
2010-03-14 02:00:00
2011-03-13 02:00:00
2012-03-11 02:00:00
2013-03-10 02:00:00
2014-03-09 02:00:00
2015-03-08 02:00:00

I opened a bug:
https://jira.talendforge.org/browse/TDI-30367
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi talendtester

Our developers are working on this issue, he suggests two solutions:
Solution 1?
Add two tJava components:
tJava_1 ---onsubjobok--->---onsubjobok--->tJava_2
tJava_1 add java code:
globalMap.put("defaultTimeZone", java.util.TimeZone.getDefault().clone());
java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("UTC"));

tJava_1(Set back the default timezone as before our last modification)
//Set back
java.util.TimeZone.setDefault((java.util.TimeZone)globalMap.get("defaultTimeZone"));

Solution 2?
Click "Run Job"> Advanced setting> check "Use specific JVM arguments"> then Add a JVM argument:
-Duser.timezone=UTC
Please let us know if it could fix your problem?
Best regards
Shong

View solution in original post

5 Replies
Anonymous
Not applicable

Hi talendtester

Our developers are working on this issue, he suggests two solutions:
Solution 1?
Add two tJava components:
tJava_1 ---onsubjobok--->---onsubjobok--->tJava_2
tJava_1 add java code:
globalMap.put("defaultTimeZone", java.util.TimeZone.getDefault().clone());
java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("UTC"));

tJava_1(Set back the default timezone as before our last modification)
//Set back
java.util.TimeZone.setDefault((java.util.TimeZone)globalMap.get("defaultTimeZone"));

Solution 2?
Click "Run Job"> Advanced setting> check "Use specific JVM arguments"> then Add a JVM argument:
-Duser.timezone=UTC
Please let us know if it could fix your problem?
Best regards
Shong
talendtester
Creator III
Creator III
Author

Both work succesfully. Solution 2 seems to be the least amount of work.
In future versions, is selecting the time zone going to be a preferences option?
Anonymous
Not applicable

Yes, we have created a jira issue for this request.
https://jira.talendforge.org/browse/TDI-30556
Best regards
Shong
Anonymous
Not applicable

Hi Team,
This issue still persists, please let me know if any work around is available. I tried both the above mentioned workaround but no luck.
Thanks and Regards
Sanket
sushantk19
Creator
Creator

Solution no 2 works perfectly fine!!