I have tried the below and this is printing Jan 1 2017.
System.out.println(TalendDate.parseDate("MM/DD/YYYY HH:mm:ss", TalendDate.getDate("MM/DD/CCYY HH:mm:ss")));
TalendDate.getDate("MM/DD/CCYY HH:mm:ss") - This part is giving current date time in given format and I need this string as date data type. When I use parsedate, it is printing 1/1/2017.
Solved! Go to Solution.
A Date is a Date, a formated Date is a date represented by a String.
Can you explain a little more what's expectation?
Result (based on Europe/Paris TZ current datetime ):
Hi, Thanks for your response.
The formatted date that's a string need to be loaded to a database table where the filed datatype is date. So, the formatted date as a string is unable to get into the date field of the table.
Yes, I tried loading that directly. Because it prints time zone in it, I had invalid character issues. I will format this at the database end. Thank you