Date Time

anandknr

Member
Hi all,

I am developing an application .

I have an start time and duration .

starttime is datatime datatype.
but duration should be entered in hours.(i have to enter 55:00 hours)

how can i calculate the end time using this.

eg:

DEF VAR starttime AS DATETIME .
DEF VAR endTime AS DATETIME .
DEF VAR duration AS CHAR .

starttime = datetime("12/01/2000 00:00:00") .
duration = "48:00" .

endTime = starttime + duaration . /* function i needed */

MESSAGE endTime VIEW-AS ALERT-BOX .

the output should be 14/01/2000 00:00:00 .

Can some one advice me the function i needed .
 
break up the starttime into two parts date and time and store them in variables (dtStrDate & iStrTime). Now add your duration to the iStrTime ( all time calculation is in seconds). In your case you will endup with 172800 seconds = 48 hours = 2 days. Now add the 2 days to dtStrDate. this will be your final enddate.
 
Back
Top