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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time Functions

Status
Not open for further replies.

AlanArons

Programmer
Aug 1, 2002
91
US
Is there a function that will allow easy time computations such as adding minutes to an hours/minutes variable to get a new hours/minutes or calcuating the difference between 2 inputs.

Thanks for your help

Alan
 
HI,

to add seconds you use give as follows.

eg.
?datetime ()
?datetime ()+ noofseconds

If you want to add a minute

?datetime ()+60

If you want to add an hour

?datetime ()+3600 && (60 Mintues ie. 60 seconds x 60
minutes)


Suggestions Invited...

gchandrujs [sunshine]

 
Is there a function that will allow easy time computations such as adding minutes to an hours/minutes variable to get a new hours/minutes or calcuating the difference between 2 inputs.

Use the datetime() function

Local time1,time2,time3
time1 = datetime()
time2 = datetime() && a few minutes or hours later
time3 = time2-time1
?time3/3600

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Is there a way to create a time input that would fit into the datetime() format? This will be used for scheduling

Alan
 
The datetimepicker ole control has a time-only mode of operation (the picker then becomes purely vestigial, but it does handle conversion of the entered time to the datetime() format).

 
AlanArons

Is there a way to create a time input that would fit into the datetime() format? This will be used for scheduling

You could put :
STORE { / / : : } to thisform.text1.Value

In the Init of you form.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top