Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've got a column in a database which is a string like this
Tue May 11 2021 00:15:17 GMT+0000 (UTC)
and i want to turn this into a date like
2021-05-11 00:15:17
Is there any prebuilt function to do this?
Thanks
You have to find the good pattern :
https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
I've tried them all but can't find one which doesn't throw an error converting
Tue May 11 2021 00:15:17 GMT+0000 (UTC) into 2021-05-11 00:15:17
You have to find the good pattern :
https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Thanks @guenneguez jeremy you set me on the right path. In the end i had to get rid of the text at the end and use the right pattern
TalendDate.parseDate("E MMM dd yyyy HH:mm:ss",redemption.transaction_date.substring(0, redemption_rakuten.transaction_date.indexOf("GMT")).trim())
Glad you find by yourself