Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 July 7th, 2003, 11:19 PM
Authorized User
 
Join Date: Jun 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding to the time

i want to add 14 hours to the current time so i did this

datTime = DateAdd("h",14,Time())

when i do this i get a date and a time returned...
i only want the time..
how do i do this so i dont get the date?

thx
 
Old July 7th, 2003, 11:20 PM
Authorized User
 
Join Date: Jun 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

also the date i get returned is
31-Dec-1899
where did this date come from?
 
Old July 7th, 2003, 11:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Try:

datTime = timevalue(DateAdd("h",14,now()))

The date was returned incorrectly because the function was expecing a date and you gave it the time.
DateAdd will always return a date so you have to extract the time part of that with timeValue().

Rod
 
Old July 7th, 2003, 11:55 PM
Authorized User
 
Join Date: Jun 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

cool
thanks:)





Similar Threads
Thread Thread Starter Forum Replies Last Post
adding multiple records at the same time Vince_421 Access VBA 14 February 1st, 2007 10:28 AM
Adding Time Fields Brendan Bartley Access 3 July 30th, 2006 08:35 PM
Adding Time Brendan Bartley Access 2 January 21st, 2006 03:36 AM
Adding two time values j_karthik72 VBScript 1 April 5th, 2004 06:43 AM
Adding time values scott Access 8 January 11th, 2004 05:39 AM





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