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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

TalendDate strange behaviour

I have a bunch of dates coming in from a MySQL database, most are "0000-00-00", but if I use TalendDate.formatDate() to print them out, talend thinks they are "0002-12-31". Not only that, but if I try to check the formatted date string with a hard-coded string, they do not match.

System.out.println((row1.photocardexpiry == null ? "no" : 
TalendDate.formatDate("yyyy-MM-dd",row1.photocardexpiry) +
(TalendDate.formatDate("yyyy-MM-dd",row1.photocardexpiry) == "0002-12-31" ? "YES!" : "")));


The results from this end up being along the lines of:

no
0002-12-31
0002-12-31
no
no
no
no
0002-12-31



When "0002-12-31" crops up, there should be a "YES!" after it, but there never is. For some reason it won't match the strings?

Labels (2)
1 Reply
_AnonymousUser
Specialist III
Specialist III
Author

Okay, it turns out I have to use .equals() to match the strings. This was just my poor knowledge of Java. Nothing to see here!


That said, I still don't understand why the "0000-00-00" dates come out as "0002-12-31" in Talend.