additional leap second

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

additional leap second

Ei-ji Nakama
hi,

Index: leap_second/src/library/base/R/zdatetime.R
===================================================================
--- leap_second/src/library/base/R/zdatetime.R    (revision 68608)
+++ leap_second/src/library/base/R/zdatetime.R    (working copy)
@@ -24,7 +24,8 @@
           "1979-12-31", "1981-6-30", "1982-6-30", "1983-6-30",
           "1985-6-30", "1987-12-31", "1989-12-31", "1990-12-31",
           "1992-6-30", "1993-6-30", "1994-6-30","1995-12-31",
-          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31", "2012-6-30")
+          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31",
+          "2012-6-30", "2015-6-30")
     .leap.seconds <- strptime(paste(.leap.seconds , "23:59:60"),
                               "%Y-%m-%d %H:%M:%S")
     c(as.POSIXct(.leap.seconds, "GMT")) # lose the timezone

Best Regards,
--
Eiji NAKAMA <nakama (a) ki.rim.or.jp>
"\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: additional leap second

Duncan Murdoch-2
On 01/07/2015 7:20 AM, Ei-ji Nakama wrote:

> hi,
>
> Index: leap_second/src/library/base/R/zdatetime.R
> ===================================================================
> --- leap_second/src/library/base/R/zdatetime.R    (revision 68608)
> +++ leap_second/src/library/base/R/zdatetime.R    (working copy)
> @@ -24,7 +24,8 @@
>            "1979-12-31", "1981-6-30", "1982-6-30", "1983-6-30",
>            "1985-6-30", "1987-12-31", "1989-12-31", "1990-12-31",
>            "1992-6-30", "1993-6-30", "1994-6-30","1995-12-31",
> -          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31", "2012-6-30")
> +          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31",
> +          "2012-6-30", "2015-6-30")
>      .leap.seconds <- strptime(paste(.leap.seconds , "23:59:60"),
>                                "%Y-%m-%d %H:%M:%S")
>      c(as.POSIXct(.leap.seconds, "GMT")) # lose the timezone
>
> Best Regards,
> --
> Eiji NAKAMA <nakama (a) ki.rim.or.jp>
> "\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>

Thanks, I'll add it to R-devel and R-patched.

Duncan Murdoch

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: additional leap second

Dirk Eddelbuettel

On 1 July 2015 at 07:36, Duncan Murdoch wrote:
| On 01/07/2015 7:20 AM, Ei-ji Nakama wrote:
| > hi,
| >
| > Index: leap_second/src/library/base/R/zdatetime.R
| > ===================================================================
| > --- leap_second/src/library/base/R/zdatetime.R    (revision 68608)
| > +++ leap_second/src/library/base/R/zdatetime.R    (working copy)
| > @@ -24,7 +24,8 @@
| >            "1979-12-31", "1981-6-30", "1982-6-30", "1983-6-30",
| >            "1985-6-30", "1987-12-31", "1989-12-31", "1990-12-31",
| >            "1992-6-30", "1993-6-30", "1994-6-30","1995-12-31",
| > -          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31", "2012-6-30")
| > +          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31",
| > +          "2012-6-30", "2015-6-30")
| >      .leap.seconds <- strptime(paste(.leap.seconds , "23:59:60"),
| >                                "%Y-%m-%d %H:%M:%S")
| >      c(as.POSIXct(.leap.seconds, "GMT")) # lose the timezone
| >
| > Best Regards,
| > --
| > Eiji NAKAMA <nakama (a) ki.rim.or.jp>
| > "\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>
|
| Thanks, I'll add it to R-devel and R-patched.

I just launched a Debian build of R 3.2.1 as well.

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: additional leap second

Brian Ripley
In reply to this post by Ei-ji Nakama
Thanks, I was working on this.

There are other changes needed in src/main/datetime.c and ?.leap.seconds
which I will commit shortly, and the example in hist.POSIXt() needed
alteration (it seems DJM did not run 'make check'!).


On 01/07/2015 06:20, Ei-ji Nakama wrote:

> hi,
>
> Index: leap_second/src/library/base/R/zdatetime.R
> ===================================================================
> --- leap_second/src/library/base/R/zdatetime.R    (revision 68608)
> +++ leap_second/src/library/base/R/zdatetime.R    (working copy)
> @@ -24,7 +24,8 @@
>             "1979-12-31", "1981-6-30", "1982-6-30", "1983-6-30",
>             "1985-6-30", "1987-12-31", "1989-12-31", "1990-12-31",
>             "1992-6-30", "1993-6-30", "1994-6-30","1995-12-31",
> -          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31", "2012-6-30")
> +          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31",
> +          "2012-6-30", "2015-6-30")
>       .leap.seconds <- strptime(paste(.leap.seconds , "23:59:60"),
>                                 "%Y-%m-%d %H:%M:%S")
>       c(as.POSIXct(.leap.seconds, "GMT")) # lose the timezone
>
> Best Regards,
> --
> Eiji NAKAMA <nakama (a) ki.rim.or.jp>
> "\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Brian D. Ripley,                  [hidden email]
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: additional leap second

Ei-ji Nakama
sorry, i didnt watch src/main/datetime.c ...

Index: leap_second/src/main/datetime.c
===================================================================
--- leap_second/src/main/datetime.c    (リビジョン 68608)
+++ leap_second/src/main/datetime.c    (作業コピー)
@@ -303,14 +303,15 @@
 }

 #ifndef HAVE_POSIX_LEAPSECONDS
-/* There have been 25 leapseconds: see .leap.seconds in R
+/* There have been many leapseconds: see .leap.seconds in R
+ * (as.Date(.leap.seconds)-as.Date("1970-01-01"))*86400
  */
-static int n_leapseconds = 25;
 static const time_t leapseconds[] =
 {  78796800, 94694400,126230400,157766400,189302400,220924800,252460800,
   283996800,315532800,362793600,394329600,425865600,489024000,567993600,
   631152000,662688000,709948800,741484800,773020800,820454400,867715200,
-   915148800,1136073600,1230768000,1341100800};
+   915148800,1136073600,1230768000,1341100800,1435708800};
+static int n_leapseconds = sizeof(leapseconds)/sizeof(time_t);
 #endif

 static double guess_offset (stm *tm)

2015-07-01 17:13 GMT+09:00 Prof Brian Ripley <[hidden email]>:

> Thanks, I was working on this.
>
> There are other changes needed in src/main/datetime.c and ?.leap.seconds
> which I will commit shortly, and the example in hist.POSIXt() needed
> alteration (it seems DJM did not run 'make check'!).
>
>
>
> On 01/07/2015 06:20, Ei-ji Nakama wrote:
>>
>> hi,
>>
>> Index: leap_second/src/library/base/R/zdatetime.R
>> ===================================================================
>> --- leap_second/src/library/base/R/zdatetime.R    (revision 68608)
>> +++ leap_second/src/library/base/R/zdatetime.R    (working copy)
>> @@ -24,7 +24,8 @@
>>             "1979-12-31", "1981-6-30", "1982-6-30", "1983-6-30",
>>             "1985-6-30", "1987-12-31", "1989-12-31", "1990-12-31",
>>             "1992-6-30", "1993-6-30", "1994-6-30","1995-12-31",
>> -          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31",
>> "2012-6-30")
>> +          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31",
>> +          "2012-6-30", "2015-6-30")
>>       .leap.seconds <- strptime(paste(.leap.seconds , "23:59:60"),
>>                                 "%Y-%m-%d %H:%M:%S")
>>       c(as.POSIXct(.leap.seconds, "GMT")) # lose the timezone
>>
>> Best Regards,
>> --
>> Eiji NAKAMA <nakama (a) ki.rim.or.jp>
>> "\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>
> --
> Brian D. Ripley,                  [hidden email]
> Emeritus Professor of Applied Statistics, University of Oxford
> 1 South Parks Road, Oxford OX1 3TG, UK



--
Best Regards,
--
Eiji NAKAMA <nakama (a) ki.rim.or.jp>
"\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: additional leap second

Duncan Murdoch-2
In reply to this post by Brian Ripley
On 01/07/2015 10:13 AM, Prof Brian Ripley wrote:
> Thanks, I was working on this.
>
> There are other changes needed in src/main/datetime.c and ?.leap.seconds
> which I will commit shortly, and the example in hist.POSIXt() needed
> alteration (it seems DJM did not run 'make check'!).

That's true.  Sometimes simple changes aren't so simple.

Duncan Murdoch

>
>
> On 01/07/2015 06:20, Ei-ji Nakama wrote:
>> hi,
>>
>> Index: leap_second/src/library/base/R/zdatetime.R
>> ===================================================================
>> --- leap_second/src/library/base/R/zdatetime.R    (revision 68608)
>> +++ leap_second/src/library/base/R/zdatetime.R    (working copy)
>> @@ -24,7 +24,8 @@
>>             "1979-12-31", "1981-6-30", "1982-6-30", "1983-6-30",
>>             "1985-6-30", "1987-12-31", "1989-12-31", "1990-12-31",
>>             "1992-6-30", "1993-6-30", "1994-6-30","1995-12-31",
>> -          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31", "2012-6-30")
>> +          "1997-6-30", "1998-12-31", "2005-12-31", "2008-12-31",
>> +          "2012-6-30", "2015-6-30")
>>       .leap.seconds <- strptime(paste(.leap.seconds , "23:59:60"),
>>                                 "%Y-%m-%d %H:%M:%S")
>>       c(as.POSIXct(.leap.seconds, "GMT")) # lose the timezone
>>
>> Best Regards,
>> --
>> Eiji NAKAMA <nakama (a) ki.rim.or.jp>
>> "\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: additional leap second

Dirk Eddelbuettel
In reply to this post by Ei-ji Nakama

On 1 July 2015 at 18:02, Ei-ji Nakama wrote:
| sorry, i didnt watch src/main/datetime.c ...

Thanks again -- I also made that update for a Debian build 3.2.1-4.

Dirk

 
| Index: leap_second/src/main/datetime.c
| ===================================================================
| --- leap_second/src/main/datetime.c    (リビジョン 68608)
| +++ leap_second/src/main/datetime.c    (作業コピー)
| @@ -303,14 +303,15 @@
|  }
|
|  #ifndef HAVE_POSIX_LEAPSECONDS
| -/* There have been 25 leapseconds: see .leap.seconds in R
| +/* There have been many leapseconds: see .leap.seconds in R
| + * (as.Date(.leap.seconds)-as.Date("1970-01-01"))*86400
|   */
| -static int n_leapseconds = 25;
|  static const time_t leapseconds[] =
|  {  78796800, 94694400,126230400,157766400,189302400,220924800,252460800,
|    283996800,315532800,362793600,394329600,425865600,489024000,567993600,
|    631152000,662688000,709948800,741484800,773020800,820454400,867715200,
| -   915148800,1136073600,1230768000,1341100800};
| +   915148800,1136073600,1230768000,1341100800,1435708800};
| +static int n_leapseconds = sizeof(leapseconds)/sizeof(time_t);
|  #endif
|
|  static double guess_offset (stm *tm)
|

--
http://dirk.eddelbuettel.com | @eddelbuettel | [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel