Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
jimbo20814
Creator
Creator

TalendDate.parseDate

All, I have a headscratcher here, I've hardcoded a date to demo. How is TalendDate.parseDate("yyyy-MM-dd HH:mm:ss.SSSSSS", "2020-06-17 21:14:28.9761776") returning the date 2020-06-17 23:57:09.000776

 

What the heck is happening here?

Labels (2)
1 Solution

Accepted Solutions
jimbo20814
Creator
Creator
Author

This has been resolved, sorry not familiar date formatting just changed to .SSS on milliseconds instead of .SSSSSS 

View solution in original post

3 Replies
Anonymous
Not applicable

Hello,

Could you please let us know if this article helps?

https://community.talend.com/t5/Architecture-Best-Practices-and/How-to-fetch-data-that-uses-the-date... 

Best regards

Sabrina

jimbo20814
Creator
Creator
Author

No, I'm not looking to get the system/current time with milliseconds. I'm looking to convert a string to a datetime with milliseconds. Interestingly enough in the article, it mentions the Java API support only three digits, so I changed the hardcoded string to...  TalendDate.parseDate("yyyy-MM-dd HH:mm:ss.SSSSSS", "2020-06-17 21:14:28.976") and now it's returning 2020-06-17 21:14:28.000976 so now its' getting the hours/minutes/seconds correct but the milliseconds is .000976 not .976

 

Why is it not returning .976 for the milliseconds and how can it be resolved?

jimbo20814
Creator
Creator
Author

This has been resolved, sorry not familiar date formatting just changed to .SSS on milliseconds instead of .SSSSSS