Datetime field using military time - need time only in standard time

后端 未结 3 499
野性不改
野性不改 2021-01-19 01:13

I have a datetime field in SQL Server 2008 which stores the date and time in military format (or international format if you prefer)

examples:

2011-         


        
3条回答
  •  旧巷少年郎
    2021-01-19 01:40

    DateTime is stored in an internal representation - there is no format associated. When you need to display the DateTime, specify the formatting you want for converting the DateTime into a string.

    It is much better to let the application decide on formatting than formatting in SQL.

    See standard and custom Date and Time Format Strings for more information.

提交回复
热议问题