Displaying 3 results from an estimated 3 matches for "isgmt".
2015 Dec 07
2
inconsistency in POSIXlt
The documentation for the POSIXlt class states '"POSIXlt" objects will
often have an attribute "tzone", a character vector of length 3 giving the
time zone name from the TZ environment variable and the names of the base
time zone and the alternate (daylight-saving) time zone. Sometimes this may
just be of length one, giving the time zone
2015 Dec 07
0
inconsistency in POSIXlt
David,
I didn't have time to dig through the code completely, but those other two
are being set automatically in the C code as far as I can tell, in
particular in the code
// localtime may change tzname.
if (isgmt) {
PROTECT(tzone = mkString(tz));
} else {
PROTECT(tzone = allocVector(STRSXP, 3));
SET_STRING_ELT(tzone, 0, mkChar(tz));
SET_STRING_ELT(tzone, 1, mkChar(R_tzname[0]));
SET_STRING_ELT(tzone, 2, mkChar(R_tzname[1]));
}
In the file https://svn.r-project.org/R/trunk/src/main/datetime.c...
2009 Feb 27
0
POSIXlt, POSIXct, strptime, GMT and 1969-12-31 23:59:59
...if(!R_FINITE(secs) || tm.tm_min == NA_INTEGER ||
696 tm.tm_hour == NA_INTEGER || tm.tm_mday == NA_INTEGER ||
697 tm.tm_mon == NA_INTEGER || tm.tm_year == NA_INTEGER)
698 REAL(ans)[i] = NA_REAL;
699 else {
700 errno = 0;
701 tmp = mktime0(&tm, 1 - isgmt);
702 #ifdef MKTIME_SETS_ERRNO
703 REAL(ans)[i] = errno ? NA_REAL : tmp + (secs - fsecs);
704 #else
705 REAL(ans)[i] = (tmp == (double)(-1)) ?
706 NA_REAL : tmp + (secs - fsecs);
707 #endif
708 }
I haven't been able to look further into this logic, but the te...