Page 1 of 1

Time / Date Calculation

Posted: Mon Feb 25, 2008 2:27 pm
by Jeff Barnes
Hi Everybody,

Does anyone know of a formula to calculate a Date and Time based on elapsed time in seconds from a certain date.

ie: The date is Jan 01 1990, Elapsed time in seconds from midnight of that date would be 572778954.

How would I get the date time of the above?

Hello Jeff

Posted: Mon Feb 25, 2008 3:27 pm
by ukoenig
I got all needed functions of data and time calculations
They are some at : http://www.pflegeplus.com/fivewin

I must look in my archiv, if this function is included
otherwise i put it in the forum

Regards
Uwe

Posted: Mon Feb 25, 2008 8:28 pm
by StefanHaupt
Jeff,

this code should work

Code: Select all

nSec := 572778954     // eleapsed seconds
nDays := Int (nSec/86400)   // get the days, 1 day = 86400 secs
nMod := nSec%86400          // get the rest
nHours := Int (nMod/3600)   // get the hours, 1 hour = 3600 secs
nMin := Int ((nMod%3600)/60)   // get the minutes

dToday := Date ()
dDate := dToday - nDays
cTime := StrZero(nHours,2,0)+":"+StrZero(nMin,2,0)

Date / Time

Posted: Mon Feb 25, 2008 10:10 pm
by ukoenig
Hello Stefan,

did you have look at my Topic Date / Time => Elapsed-Function ?
With this function you have some more informations.

Regards
Uwe :lol:

Posted: Tue Feb 26, 2008 1:12 am
by Jeff Barnes
Thanks Uwe and Stefan, I will give your ideas a try.

Re: Date / Time

Posted: Tue Feb 26, 2008 8:21 am
by StefanHaupt
Hi Uwe,
ukoenig wrote: did you have look at my Topic Date / Time => Elapsed-Function ?
With this function you have some more informations.
not yet, but i´ll do it