Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 28th, 2004, 09:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default displaying date and time

Can somebody please tell my why the date and time will not display correctly on a page when selected from a sql server. Here is what is happening, If I select the date and time field of 10/27/2004 12:15:00 AM it will display as such, but if I use 10/27/2004 12:00:00 AM only the 10/27/2004 will display when selected, I have tried everything I can think of. If I use format it as FormatDateTime(rs("EndingTime"), 4) then just the 12:00:00 AM appears, so I know it's in the server.

this is my response.write update statement:
UPDATE TimeTracker SET StartingTime = '10/27/2004 7:00:00 PM',
EndingTime = '10/28/2004 12:00:00 AM', WhatIDid = 'asdfasdf',
Statis = 'Turned In' WHERE Task = 7;

Thanks in advance
Mike
__________________
Peace
Mike
http://www.eclecticpixel.com
 
Old October 28th, 2004, 10:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

me again, I was having problems accessing the database this morning so once I finally did I discovered the 12:00:00 AM is not being input, even though it is in the sql string. So that explains why the time would not display, now can anybody tell me why it will input the date but not the time.

mike
 
Old October 29th, 2004, 09:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:I discovered the 12:00:00 AM is not being input, even though it is in the sql string. So that explains why the time would not display, now can anybody tell me why it will input the date but not the time.
What is the datatype of that column? If that is datetime, as the name itself stands for DATE and TIME together, all values input would have DATE and TIME part in it. Either you give just DATE part as input value or both DATE and TIME parts as input. When you just specify the DATE as input, it assumes "12:00:00 AM" as its default TIME part.

So anything like "2004-10-30" is considered as "2004-10-30 12:00:00.000 AM" unless you specify the TIME part on your own.

Now the question is "Can you explain how you have extracted that on to your page?" and how you want that to be displayed on your page?

Cheers!

_________________________
- Vijay G
Strive for Perfection




Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying Continuous Time (Clock) mjwelker VB How-To 4 April 8th, 2009 05:15 PM
date and time in EST time zone anboss XSLT 1 May 21st, 2008 01:42 PM
problem displaying records in order of time ,date method PHP Databases 3 July 25th, 2006 08:16 PM
Error - Not Displaying time jzycn2 ASP.NET 1.0 and 1.1 Basics 2 October 18th, 2005 01:32 PM
insert system date. no date and time jimmy Access VBA 6 November 20th, 2003 01:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.