[R] as.POSIXct problem?

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Fri Jan 3 20:55:03 CET 2003


Can you supply us with details?  For the ISO C99 standard actually says

The mktime function returns the specified calendar time encoded as a value
of type time_t. If the calendar time cannot be represented, the function
returns the value (time_t)-1.

and that is the behaviour that R expects.  Note that POSIX specifies what
time_t is, but ISO C does not, so I am at a loss as to how this can be
`more compliant with the ISO C standard'.


On 3 Jan 2003, Suchandra Thapa wrote:

> On Fri, 2003-01-03 at 12:44, ripley at stats.ox.ac.uk wrote:
>     On Fri, 3 Jan 2003, Frank E Harrell Jr wrote:
>     > I get NA for any day in 1969 or earlier.  Using a time other than midnight did not help.  So it's not a problem with time zone changes on a given day (thanks, Brian and Don for suggesting I look at that).
>
>     Ahah, so Dirk's guess was right for your machine!  That's a new bug in
>     some version of glibc, I suppose.  Exactly what OS are you running, and
>     version of glibc (if you can tell)?
>
> I believe the problem is that the glibc developers recently changed
> mktime to return an error for any date before Jan 1, 1970.  The
> rationale for this was to make the mktime function more compliant with
> the ISO C standard so I believe the the new behavior is here to stay
> barring a large amount of complaints. Unfortunately, this means that all
> linux distributions will have this problem as they upgrade to newer
> versions of glibc.
>
> --
> ------------------------------------------------------------------
>
> Suchandra S. Thapa
> s-thapa-11 at alumni.uchicago.edu
>
> ------------------------------------------------------------------
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list