Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to parse string into date?

How can I convert a String to a Date in T-SQL?

My test case is the string: '24.04.2012'

like image 632
Nazar Tereshkovych Avatar asked Apr 24 '12 19:04

Nazar Tereshkovych


People also ask

Can we convert string to date in java?

By default, Java dates are in the ISO-8601 format, so if we have any string which represents a date and time in this format, then we can use the parse() API of these classes directly.


1 Answers

CONVERT(datetime, '24.04.2012', 104) 

Should do the trick. See here for more info: CAST and CONVERT (Transact-SQL)

like image 85
Chris Roberts Avatar answered Oct 03 '22 09:10

Chris Roberts