Welcome to SqlServer-QA.net Sign in | Join | Help

SQL Server Storage Engine & Tools (SSQA.net)

SQL Server Tools includes storage engine that includes a complete set of graphical tools and command prompt utilities that allow users, programmers, and administrators. SSMS, SSRS, SSIS & SSAS are most commonly used tools.
What is the default datetime format in SQL Server?

There might be various questions in the forums asking what is the default datetime format in SQL Server, how to change the date format.

Further into the details  make a note that there is no international standard for representation of datetime values. ISO-8601 has a huge number of options, and SQL Server accepts at least a couple of the ISO-8601 alternatives. So in this case if the application is designed to wrap up on the time and having orientation of internal time formats due to the geographical locations then there is an issue in representing the right value. The internal locale settings would normally take care of such representation. Also most of the Microsoft application supports the timezones and not all other products support timezones, so your data will end up with different values on different products.

In this case it is better to present the data with a consistent format by eliminating the issues or convert the
timezone data in your front end, and send every back end you connect to datetime values as strings of the form 'YYYYMMDD HH:MM:SS' (seconds optional or with fractional seconds as well).

Further depending on the language set in your database (normally english) you have to format Dates accordingly. For the english language format this is: MM/DD/YYYY and to change the format refer to this KBA  link.

Also I would like to refer few other articles that are based on date-time in SQL Server:

Check also this one: http://www.karaszi.com/SQLServer/info_datetime.asp artcile and another in-depth datetime information from  http://www.sql-server-performance.com/fk_datetime.asp here.

Posted: Tuesday, May 08, 2007 7:18 AM by SQL Master

Comments

ssqa said:

There might be various questions in the forums asking what is the default datetime format in SQL Server

# May 9, 2007 1:45 AM
Anonymous comments are disabled