An investment in knowledge
pays the best interest.
-Benjamin Franklin
 
Home   News   Courses   Seminars   Templates   Help   TechHelp   Forums   Order   Contact   Logon  
 
Home > Forums > ASP
 
Active Server Pages Forum

Welcome to the ASP Forum. I love Classic ASP. My whole web site is built with that, Javascript, and of course HTML from scratch. Post your questions here. Feel free to ask about ASP.NET too. I'm not an expert (yet) but I can make my way around it, and yes, I'm brushing up my skills to I can prepare some ASP.NET lessons soon.

This forum is for everyone to read but only students (paid customers) can post here. If you'd like to become a student, you can watch ASP Beginner Level 1 for free, and then purchase Level 2 for just $1.00 here. After you create a logon, you will have full access to the Forums.

Subscribe to this forum and receive an email update whenever new posts are added. You will also be notified by email if any conversations you are involved in receieve new comments. Yes, even non-students can subscribe to update notifications.

Click Here to Post a comment and start a new discussion!

Strange date returned Link 
MUBEEZI M 
7 years ago
Dear Richard,

i have formular in my ASP code as follows
TimeNow = DateAdd("h", 10, Time)

Most of the time, it gives me correct results. But sometimes, it gives me 31/12/1899 07:37:33
How do i make sure, i get only 07:37:33 and not the portion of the date?
Thank you!

MICAH



Reply from Richard Rost:

That's interesting. I've never run into that before. Looks like you're ending up with a NEGATIVE date value somehow - because date values are actually the number of seconds since Jan 1st, 1900. NORMALLY, with a valid date, you could strip off the date portion by saying:

CurrentTimeOnly = Now()-Date()

That would give you just the hours, minutes, and seconds. However, since you're getting dates before 1/1/1900, you'll have to get creative and break it up into HOUR(), MINUTE(), SECOND() and then use the TIMESERIAL() function to put them back together into a valid TIME datatype.

Strange indeed.

Add a Reply

Show All Comments

Post a New Comment or Question
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 
 
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search The Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

YouTube Channel    LinkedIn

Blog RSS Feed   
Keywords: asp forum active server pages  PermaLink