diff --git a/ChangeLog b/ChangeLog index 03144f045..c97758ea6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2017-01-04 Dirk Eddelbuettel + + * src/Date.cpp (Rcpp): Protect assignment to tm_gmtoff to not being + under MinGW; could potentially bite other too-limited systems + + * inst/unitTests/runit.Date.R (test.Datetime.formating): Do not set TZ + when running test, only set digits option + 2017-01-01 Dirk Eddelbuettel * inst/unitTests/runit.Date.R (test.mktime, test.gmtime): New tests diff --git a/inst/unitTests/runit.Date.R b/inst/unitTests/runit.Date.R old mode 100644 new mode 100755 index a6193aae5..22feb92ff --- a/inst/unitTests/runit.Date.R +++ b/inst/unitTests/runit.Date.R @@ -217,9 +217,6 @@ if (.runThisTest) { } test.Datetime.formating <- function() { - oldTZ <- Sys.getenv("TZ") - Sys.setenv(TZ="America/Chicago") - olddigits <- getOption("digits.secs") options("digits.secs"=6) @@ -234,7 +231,6 @@ if (.runThisTest) { format(d, "%Y-%m-%d %H:%M:%OS"), msg="Datetime.formating.ostream") - Sys.setenv(TZ=oldTZ) options("digits.secs"=olddigits) } diff --git a/src/Date.cpp b/src/Date.cpp index cb3aff202..e2b073c80 100644 --- a/src/Date.cpp +++ b/src/Date.cpp @@ -1347,9 +1347,10 @@ struct tzhead { idays -= ip[tmp->tm_mon]; tmp->tm_mday = (int) (idays + 1); tmp->tm_isdst = 0; - //#ifdef HAVE_TM_GMTOFF +#if ! (defined(__MINGW32__) || defined(__MINGW64__)) +//#ifdef HAVE_TM_GMTOFF tmp->tm_gmtoff = offset; - //#endif +#endif return tmp; }