Unix Timestamp
Fairlight
fairlite at fairlite.com
Sun Dec 29 20:32:23 PST 2013
On Sun, Dec 29, 2013 at 09:52:17PM -0500, Kenneth Brody thus spoke:
> As I recall, "Unix time" is the number of seconds since 00:00:00 UTC
> 1-Jan-1970. I do not know if it takes leap seconds into account.
>
> Assuming leap seconds are not involved...
>
> I believe that this *untested* pseudo-code would do it:
>
> Epoch(10,mdyy/) = "01/01/1970"
> Date(10,mdyy/) = Epoch + INT(UnixTime / "86400")
> Time(8,TIME) = MOD(UnixTime,"86400") / "3600"
>
> (There are 86,400 seconds in a day and 3,600 seconds in an hour.)
>
> Note, however, that this results in a UTC time, and is not adjusted for the
> current timezone. This can be done by adding/subtracting the appropriate
> number of seconds from the original UnixTime.
For the love of all that's good and holy, why reinvent the wheel that's
been available at the system level for ages?
Why not just supply fP wrapper functions for the standard functions time(),
mktime(), localtime(), gmtime(), et al, so it's done properly, without
guesswork? The system -will- do all the work for you, as intended. It
will even take time zones into account.
I've only been asking for proper unix timestamp functionality in filePro
since what, 1993?
Oh wait...but we have a spell checker... Nevermind. That's infinitely
more useful!
Ob: *eyeroll*
mark->
--
Audio panton, cogito singularis.
More information about the Filepro-list
mailing list