Timestamp Precision

Timestamp Precision

am 21.01.2008 22:28:50 von t8ntboy

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.

Re: Timestamp Precision

am 21.01.2008 23:39:07 von Plamen Ratchev

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
http://www.SQLStudio.com