Timestamp Precision

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • t8ntboy

    Timestamp Precision

    I am using ASP and SQL 2005 Express.

    I am inserting a timestamp from an ASP page using <%=now%into a
    smalldatetime field. All of my timestamps are appearing without any
    seconds (e.g., 1/21/2008 4:02:00 PM or 1/18/2008 11:32:00 AM).


    When I view the source for my page is shows the date/time as 1/21/2008
    4:27:31 PM, but for some reason the seconds will be converted to
    1/21/2008 4:27:00 PM

    How do i get more a more precise timestamp?

    Please help.
  • Plamen Ratchev

    #2
    Re: Timestamp Precision

    The SMALLDATETIME data type in SQL Server is with precision to the minute,
    so this is why you see the seconds trimmed off. If you want to store seconds
    then you have to alter your table and change the column to DATETIME data
    type.

    HTH,

    Plamen Ratchev


    Comment

    Working...