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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

TalendDate.parseDate - Weird behavior

Hi,
I've my input field of string type that stores date in YYYYMMDD format. I want to convert it to date type keeping the format same.
I tried using following expression in tmap expression editor but it always gives me output date in standard format instead of desired format (YYYYMMDD).
TalendDate.parseDate("YYYYMMDD", row2.source_date)
Another issue is it is giving me a constant date - Sun Dec 27 00:00:00 CST 2015 even if I give below expression which should ideally give me current date in the output of date type in format YYYYMMDD.
TalendDate.parseDate("YYYYMMDD",TalendDate.getDate("YYYYMMDD"))
Please could someone provide inputs on this issue.
Thanks!

Labels (2)
1 Reply
Anonymous
Not applicable
Author

First of all a real Date typed object HAS NO format. Formats or pattern are only used to convert a Date object into a textual representation and back.
Therefore such expressions like  TalendDate.parseDate("YYYYMMDD",TalendDate.getDate("YYYYMMDD")) simply does not make sense (except you want to get rid of the time part) because you transform the current Date into a text form an after that converting back into a Date object.
If you anywhere read a Date in the standard output format that does not mean anything bad for you, it is simply the fact the standard pattern to render a Date object was applied.
But you did not described actually where your problem is.