[Rd] RFC: System and time support functions in R

Prof Brian Ripley
Thu, 20 Jul 2000 13:33:51 -0000

> From: Martin Maechler <maechler@stat.math.ethz.ch>
> Date: Thu, 20 Jul 2000 15:24:33 +0200 (CEST)
> To: Prof Brian Ripley <ripley@stats.ox.ac.uk>

>     BDR> ISO C (aka ANSI C) has time_t, but no guarantee that it is
seconds
past
>     BDR> 1/1/1970.  POSIX in general tightens up the definitions
considerably.
>
> Most you probably know this, .. but
> since there's the "unix millenium bug" aka "C millenium
bug",
> POSIX or it's successor will have to extend/change the definition of
time_t
> to use 64bit integers (or something else) instead of (32-bit) long int as
> it is now, since time will overflow some time in 2038 (?).
> Our structure should make sure to accomodate more than only about 2^31
> seconds since 1970-Jan-01.

Nothing in POSIX that I know of says time_t has to be an signed 32-bit int,
and some systems use long (64-bit) or double or long double already,
my book says.  There is already a problem with 32-bit ints in only
going back to the early years of this century.

This is an argument against making use of the system conversion
functions for a chron replacement, and I think that what I called
POSIXtm (an list) is a more general format.

> chron() even now uses double which should be okay, even if we'd go down
to
> parts of seconds -- something we might consider.

I intended to use double in R to store time_t.  (Yes, I know file.info
does not currently, but what is there is a place holder.)

> How are financial "tick data" recorded nowadays (and in five
years from now)

To one second, those that I have used.