Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript 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
  #1 (permalink)  
Old November 5th, 2003, 09:49 AM
Registered User
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding two time values

Can any one help me in adding two time values in vbscript

time1 = 02:45
time2 = 12:45
Reply With Quote
  #2 (permalink)  
Old April 5th, 2004, 06:43 AM
Registered User
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to krigans Send a message via Yahoo to krigans

  Can try this example if it works for u
'time1 = 02:45
'time2 = 12:45

Time1 = "01/01/1999 02:45:00"
Time2 = "01/01/1999 12:45:30"

'VBGeneralDate 0 Display the date and time using system settings
'VBLongDate 1 Display the date in long date format Saturday, June 26, 1943
'VBShortDate 2 Display the date in short date format 6/26/43
'VBLongTime 3 Display the time in long time format 3:48:01 PM
'VBShortTime 4 Display the time in short time format (24 hour clock) 15:48

wscript.echo FormatDateTime(CDate(time1) + CDate(time2),4)

Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
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 time values scott Access 8 January 11th, 2004 05:39 AM
Adding to the time Droopy Classic ASP Basics 3 July 7th, 2003 11:55 PM

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