473,408 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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.
Jan 21 '08 #1
1 3367
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

Jan 21 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Craig Bailey | last post by:
I have several scripts that send email using PHP's mail() function. I recently noticed that the time sent displayed inside those messages is approximately one hour ahead of the actual time. (It's...
0
by: Jeff Boes | last post by:
Can anyone explain why this happens? (under 7.4.1) select '2004-05-27 09:00:00.500001-04' :: timestamp(0) ; timestamp --------------------- 2004-05-27 09:00:01 select '2004-05-27...
1
by: Vilson farias | last post by:
Greetings, I was doing some tests with timestamps and intervals and I've discovered, for my surprise, that I can't set precision for resulting fields of type interval when I'm executing a query....
6
by: Crirus | last post by:
How to get a timestamp for curent time?
1
by: mboes | last post by:
Hi there, Is there a way of specifying the precision of a timestamp *with timezone* field? It works fine for timestamps *without* timezones, but gives me a syntax error if I try with...
2
by: Zygo Blaxell | last post by:
I have a table with a few million rows of temperature data keyed by timestamp. I want to group these rows by timestamp intervals (e.g. every 32 seconds), compute aggregate functions on the...
5
by: Simen Haugen | last post by:
Hi. How can I convert a python datetime to a timestamp? It's easy to convert a timestamp to datetime (datetime.datetime.fromtimestamp(), but the other way around...?) -Simen
67
by: James Harris | last post by:
I have a requirement to store timestamps in a database. Simple enough you might think but finding a suitably general format is not easy. The specifics are 1) subsecond resolution - milliseconds...
5
Plater
by: Plater | last post by:
So I have been working with the SNTP protocol (RFC4330) And it is saying that the timestamp format of 64bits is: . 1 2 3 0 1...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.