What is the culture neutral dateformat for SQL Server

雨燕双飞 提交于 2019-12-04 05:21:33

I recommend reading Tibor Karaszi's The ultimate guide to the datetime datatypes.

If you input your date/time in unseparated or ISO 8601 format, then you should be fine with any configuration.

Unseparated = 'yyyymmdd hh:mm:ss'
ISO 8601    = 'yyyy-mm-ddThh:mm:ss'

Update (from comments):

If you need to enter a date only (without the time part), then you have to use the 'YYYYMMDD' format, as 'YYYY-MM-DD' will not work. See the linked article for an example.

You could consider storing your date/times in UNIX time format.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!