Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 MattE
		
			MattE
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 gjeremy16170881
		
			gjeremy16170881You have to find the good pattern :
https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
 gjeremy16170881
		
			gjeremy16170881 MattE
		
			MattE
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 gjeremy16170881
		
			gjeremy16170881You have to find the good pattern :
https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
 MattE
		
			MattE
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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())
 gjeremy16170881
		
			gjeremy16170881Glad you find by yourself
