From rol@nd@fu@@ @ending from thuenen@de  Fri May 18 08:15:56 2018
From: rol@nd@fu@@ @ending from thuenen@de (=?UTF-8?Q?Roland_Fu=c3=9f?=)
Date: Fri, 18 May 2018 08:15:56 +0200
Subject: [Rd] Date method of as.POSIXct does not respect tz
In-Reply-To: <23293.49665.770796.423446@stat.math.ethz.ch>
References: <65932fa5-535d-19e4-2a70-7a6ffd10dfa4@thuenen.de>
 <23293.49665.770796.423446@stat.math.ethz.ch>
Message-ID: <f2c2ea2b-e65f-b53a-5393-c8a503aada92@thuenen.de>


Am 17.05.2018 um 19:55 schrieb Martin Maechler:
>>>>>> Roland Fu?
>>>>>>     on Wed, 16 May 2018 17:21:07 +0200 writes:
>
>     > R 3.5.0 Is it intended that the Date method of as.POSIXct
>     > does not respect the tz parameter? I suggest changing
>     > as.POSIXct.Date
>
> which is
>
>      function (x, ...) .POSIXct(unclass(x) * 86400)
>
>     > to this:
>
>     function (x, tz = "", ...)
>          .POSIXct(unclass(x) * 86400, tz = tz)
>
> or rather just forward the '...', i.e., use
>
>     function (x, ...) .POSIXct(unclass(x) * 86400, ...)
>
> ??

Then .POSIXct should gain the ellipses as an argument if you don't want 
to break code that relies on as.POSIXct.Date accepting superfluous 
arguments.

Btw. I think it's a bit unfortunate that as.POSIXct and as.POSIXlt don't 
throw an error when passed an invalid timezone string. But that would be 
more difficult to change.

>
>     > Currently, the best workaround seems to be using the
>     > character method if one doesn't want the default timezone
>     > (which is often an annoying DST timezone).
>
>     > This came up on Stack Overflow:
>     > https://stackoverflow.com/q/50373340/1412059
>
>     > --
>     > Roland
>
> Thank you Roland for your notice (and the help on SO).

Thank you and the rest of R-core for maintaining and improving one of my 
work tools and my favorite programming language!

>
> Best,
> Martin
>

-- 
Roland



[Rd] Date method of as.POSIXct does not respect tz
=?UTF-8?Q?Roland_Fu=c3=9f?=