Time / Date Calculation

Time / Date Calculation

Postby Jeff Barnes » Mon Feb 25, 2008 2:27 pm

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?
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Hello Jeff

Postby ukoenig » Mon Feb 25, 2008 3:27 pm

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
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby StefanHaupt » Mon Feb 25, 2008 8:28 pm

Jeff,

this code should work

Code: Select all  Expand view
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)
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Date / Time

Postby ukoenig » Mon Feb 25, 2008 10:10 pm

Hello Stefan,

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

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Jeff Barnes » Tue Feb 26, 2008 1:12 am

Thanks Uwe and Stefan, I will give your ideas a try.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Date / Time

Postby StefanHaupt » Tue Feb 26, 2008 8:21 am

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
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests