FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Time / Date Calculation
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Time / Date Calculation
Posted: Mon Feb 25, 2008 02: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)
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Hello Jeff
Posted: Mon Feb 25, 2008 03: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.
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Time / Date Calculation
Posted: Mon Feb 25, 2008 08:28 PM
Jeff,

this code should work

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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Date / Time
Posted: 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.
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Time / Date Calculation
Posted: Tue Feb 26, 2008 01:12 AM

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

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Date / Time
Posted: Tue Feb 26, 2008 08: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

Continue the discussion