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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

TalendParseDate error

Hi All ,

The below command is not working properly with YYYY and the same is working good with yyyy

 

TalendDate.parseDate("MMM dd YYYY",TalendDate.getDate("MMM dd yyyy")

 

TalendDate.parseDate("MMM dd yyyy",TalendDate.getDate("MMM dd yyyy")

 

Can someone suggest the purpose of YYYY and when can i use and why it is giving invalid result.

 

Thanks,

Bharath

Labels (2)
8 Replies
Anonymous
Not applicable
Author

Hi Bharat,

 

since java is case sensitive so YYYY does not work for it.

The date format always has dd MM yyyy .

Let me know more about your requirement.

 

Regards,

Neha

 

 

Anonymous
Not applicable
Author

hi neha,

 

Here there is no requirement .both commands are working properly, but

YYYY is not giving correct result and yyyy is giving correct result, 

may i know the reason why YYYY is not throwing error and giving junk value or any significance for YYYY

Anonymous
Not applicable
Author

Hi,

 

Well I have faced error saying : Invalid character near 'Y' , whenever I have used YYYY by mistake in my date formats instead of yyyy.

Like for exmaple, M is always capital and d is always small in a date format ,similarly y is always small. It will simply not work with capital Y because its something in-built in java, as far as my knowledge is concerned.

I wish I could help you more in this by seeing any screen-shot and figure out the exact issue. let me know if I can solve more.

 

Thanks,

Neha

Anonymous
Not applicable
Author

Hi,

"yyyy" stands for Year in Java Date. You can get date pattern from schema setting.

Please have a look at my screenshot.

0683p000009LsA1.png

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi ,

 

The command i posted, it  is not throwing any parsing error and it is working fine and giving  improper result.

 

Thanks,

Bharath

Anonymous
Not applicable
Author

yyyy is stands for year and wat about YYYY and why it is not throwing error. 

YYYY is giving result which is not correct result and the result for YYYY is on what basis caluclated.

cterenzi
Specialist
Specialist

https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

 

According to the Java docs, 'Y' represents "Week Year" which is slightly different from 'y'.

 

This stackoverflow article goes into more detail:
https://stackoverflow.com/questions/8686331/y-returns-2012-while-y-returns-2011-in-simpledateformat

Anonymous
Not applicable
Author

Hello,

Thanks for sharing the related docs with us.

 

Best regards

Sabrina