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: 
mks02
Creator
Creator

Pass default timestamp in Datetimestamp date formatting

Hi,

I need to pass date with timestamp and then store that date in db column (Mysql).

 

If date is "2019-04-24T01:39:06.541" then it stored as it is in db column "2019-04-24 01:39:06"  (date timestamp, no milliseconds required)

 

If date is "2019-04-24T01:23" then it need to be store in db column as : "2019-04-24 01:23:00"  (date timestamp with default 00 seconds, no milliseconds required)

 

I am doing above thing as: TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss", "2019-04-24T01:39:06.541") 
Its working correctly, but for TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss", "2019-04-24T01:23"), throwing error as : Unparseable date.

 

How to pass default values 00, if minute or seconds part is not in Input string.


Please suggest to solve this.

  

Labels (3)
0 Replies