Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding to current time

Status
Not open for further replies.

bevan

Programmer
Jan 11, 2001
22
0
0
GB
HI!
I would like to know how to add to the current time.
The following is some vbscript that I am trying to convert to javascript. Bascially when the user chooses the priority of a job it calls a function which will add either four hours or a day to the current time and put that as the time the job is due

extract of code:

case "1"
strDate += #04:00:00#
CalcDate(strDate)
case "2"
strDate += 1
CalcDate(strDate)

but how do you add four hours to the current time in java? Or a day? Does it need to be split up into hours and minutes etc?

Thanks in advance.

Bevan
 
JavaScript has certain methods for this - or do you want to pass something from the VBScript part?

e.g.

var today = new Date();
var currentHour = today.getHours();
var hourPlus4 = currentHour + 4;



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top