dbTalk Databases Forums  

Timestamp Precision

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Timestamp Precision in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
t8ntboy
 
Posts: n/a

Default Timestamp Precision - 01-21-2008 , 03:28 PM






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.

Reply With Quote
  #2  
Old   
Plamen Ratchev
 
Posts: n/a

Default Re: Timestamp Precision - 01-21-2008 , 04:39 PM






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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.