Check date format in SQL

Copper Contributor

How do i check format of date in SQL meaning either it is MM/DD/YYYY of DD/MM/YYYY,

3 Replies

@Sandip11850 , that's not really possible.

A date like 04/05/2023 is a valid one for both formats.

Thanks for reply @olafhelper .

But then how SQL differentiates between such dates Either it is 4 May 2023 or 5 April 2023.

or if date format is chosen for Field while creating data table in the SQL.

So How do we get that, in which format date is stored.

 

@Sandip11850 if you have a table column of type date/datetime, then SQL Server stores the value as some binary/numeric without any format information.

It's always the frontend that formats the value and a good app should consider here the localize settings of the user.