Times stored incorrectly in SQL Server

  • Although the Regional Options of our SQL server are clearly showing that the time will be display in 24 hr format with no AM or PM as e.g.

    20:41:03

    when we store this time in a nvarchar field on SQL Server it stores it as

    8:41:03 PM

    Very strange, any ideas?

    Steve

  • This is beacause it's undergoing a conversion. The default style is:

    hh:mm:ss (AM|PM)

    You can look under CAST AND CONVERT in Books Online for more information about the conversion.

    K. Brian Kelley

    http://www.truthsolutions.com/

    Author: Start to Finish Guide to SQL Server Performance Monitoring

    http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1

    K. Brian Kelley
    @kbriankelley

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply