Displaying 20 results from an estimated 10000 matches similar to: "Problem(?) in strptime() -- short version"
2002 May 03
1
Daylight savings time and conversion to POSIXt (arghh!)
I have asked this question before, and received some suggestions for
work-arounds that get the job done--and they are much appreciated.
But I would still like to find out if I'm missing something, and
whether there is a direct way using POSIXt functions (as.POSIXct,
as.POSIXlt, strptime, in particular).
I have environmental data collected once per minute. Here is a subset
of 3 input
2002 Apr 08
1
Problem(?) in strptime()
I think the following examples illustrate the crux of the matter
(version and OS info are below).
The problem has to do with the transition from standard time to
daylight savings time. My timezone, US/Pacific, has two parts:
standard time (PST) 8 hours behind GMT and daylight savings time
(PDT) 7 hours behind GMT. The transition takes place this year on 7
April at 02:00, when 02:00 is
2007 Jan 08
1
Does strptime(...,tz="GMT") do anything?
Hi All
In trying to correlate some tide gauge data I need to deal with varying
timezones. From the documentation on strptime, it seemed that the tz
variable might have some effect on the conversion, but I'm not seeing an
effect.
> strptime("20061201 1:02 PST",format="%Y%m%d %H:%M",tz="PST")+0
[1] "2006-12-01 01:02:00 EST"
>
2020 Nov 01
0
strptime() keeps emitting warnings after establishing a handler with tryCatch()
Hello,
I cannot reproduce this behavior and, as documented, the posted code
doesn't issue warnings due to a wrong timezone but I'm running
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK:
2020 Oct 31
2
strptime() keeps emitting warnings after establishing a handler with tryCatch()
Dear list members,
I have come about a peculiar behavior in R (4.0.2) which I would
describe as a bug.
On macOS, where `strptime()` raises a warning for invalid timezone
identifiers, the following code will continue to raise the original
warning with every subsequent call to `strptime()`:
```
# attach a handler for warnings for this call only:
tryCatch(strptime('2020-10-31 18:30', format
2016 Feb 04
3
Fwd: [musl] strptime() question
There is incompatibility between R strptime and musl libc. I posted
about it on their mailing list, but they need more information I can't
provide, so I'm forwarding the message here in hope R developers can
help. Thanks.
---------- Forwarded message ----------
From: Rich Felker <dalias at libc.org>
Date: Thu, Feb 4, 2016 at 2:07 PM
Subject: Re: [musl] strptime() question
To: Alba
2003 Jan 03
4
as.POSIXct problem?
Under
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
minor 6.1
year 2002
month 11
day 01
language R
> x <- strptime(c('10/10/1969','12/31/2002'),format='%m/%d/%Y')
2004 Aug 18
1
Fwd: strptime() problem? - Resolved
Hi Gabor and everybody;
Thanks Gabor, with the alternative step you've told me the problem is
resolved. Comparing the two procedures:
Extract from the source 'character' data:
> rain$ts[2039:2046]
[1] "25/03/2000 22:00:00 UTC" "25/03/2000 23:00:00 UTC"
[3] "26/03/2000 00:00:00 UTC" "26/03/2000 01:00:00 UTC"
[5] "26/03/2000 02:00:00
2004 Aug 17
3
Fwd: strptime() problem?
Hi all;
I've already send a similar e-mail to the list and Prof. Brian Ripley
answered me but my doubts remain unresolved. Thanks for the clarification,
but perhaps I wasn't clear enough in posting my questions.
I've got a postgres database which I read into R. The first column is
Timestamp with timezone, and my data are already in UTC format. An 'printed'
extract of R
2011 Mar 10
1
Timezone issue with strftime/strptime and %z and %Z
Hello!
I've been trying to get this right for quite a while now and fear
there is an easy solution I just don't see. I did not have this
problem in Linux, and I searched r-help and Google but did not find a
solution, but of course I am grateful for and resources I might not
have found our not understood yet.
I try to parse a time stamp with time zone. I essentially just want to
parse the
2016 Mar 12
2
Regression in strptime
On 3/12/16 12:33 AM, peter dalgaard wrote:
>> On 12 Mar 2016, at 00:05 , Mick Jordan <mick.jordan at oracle.com> wrote:
>>
>> This is definitely obscure but we had a unit test that called .Internal(strptime, "1942/01/01", %Y/%m/%d") with timezone (TZ) set to CET.
> Umm, that doesn't even parse. And fixing the typo, it doesn't run:
>
>>
2016 Mar 15
4
Regression in strptime
>>>>> peter dalgaard <pdalgd at gmail.com>
>>>>> on Sat, 12 Mar 2016 19:11:40 +0100 writes:
> OK, .Internal is not necessary to reproduce oddity in this area. I also see things like (notice 1980)
>> strptime(paste0(sample(1900:1999,80,replace=TRUE),"/01/01"), "%Y/%m/%d", tz="CET")
...............
>
2016 Feb 06
1
Fwd: [musl] strptime() question
It is setting TZ and using tzset(). R is not multi-threaded so it is safe.
Simon figure out the important settings from the config.log and
config.h files on a musl system:
/* #undef USE_INTERNAL_MKTIME */
#define HAVE_TM_GMTOFF 1
#define HAVE_TM_ZONE 1
Does this help anyone debug the issue? Simon just went on vacation.
On Thu, Feb 4, 2016 at 7:32 PM, Rich Felker <dalias at libc.org>
2005 Oct 25
2
strptime problem for 2004-10-03 02:00:00
Hello, I at first thought this was a system or locale issue, but since
it occurs on
both Windows and Linux and only for 2004 (AFAIK) I report it.
I have a problem with as.POSIXct for the hour between
"2004-10-03 02:00:00 GMT" and "2004-10-03 02:59:59 GMT".
In short, the 2 AM (GMT) hour in 2004 (but not in other years) is
interpreted as 1 AM by strptime:
(I use ISOdatetime
2004 Aug 17
1
strptime() bug? And additional problem in package "tseries"
Hi all, I've got some problems with irts objects, one of which could be a bug:
1) Read a table with several columns from Postgres and the first column is
Timestamp with timezone (this is OK). An extract is:
raincida$ts:
[2039] "25/03/2000 22:00:00 UTC" "25/03/2000 23:00:00 UTC"
[2041] "26/03/2000 00:00:00 UTC" "26/03/2000 01:00:00 UTC"
[2043]
2016 Mar 11
2
Regression in strptime
This is definitely obscure but we had a unit test that called
.Internal(strptime, "1942/01/01", %Y/%m/%d") with timezone (TZ) set to
CET. In R-3.1.3 that returned "1942-01-01 CEST" which, paradoxically, is
correct as they evidently did strange things in Germany during the war
period. Java also returns the same. However, R-3.2.4 returns "1942-01-01
CET".
2011 Feb 08
3
strptime "March 14 2010" and NA?
Converting date strings that range between Mar-14-2010 2:00 and
Mar-14-2010 2:59 (inclusive) to date objects (POSIX) returns a NA entity:
> strptime("3/14/2010 2:00",format="%m/%d/%Y %H:%M")
[1] "2010-03-14 02:00:00"
This looks fine, however other functions such as plot see a NA object
instead:
> is.na(strptime("3/14/2010
2008 May 30
3
Strptime
Hi
This code should explain what I'm trying to do
> strptime("30-Jan-08", "%d-%b-%y")
[1] "2008-01-30"
>
> format(strptime("30-Jan-08", "%d-%b-%y") , "%b-%y")
[1] "Jan-08"
>
> strptime(format(strptime("30-Jan-08", "%d-%b-%y") , "%b-%y") ,
"%b-%y")
[1] NA
I have a
2013 Jan 11
1
Date time conversion bug (as.POSIXct)?
There is something wrong, I think, with the date-time conversion from a
numeric value if you use Central European Time (CET) as timezone.
Examples from R:
If I use the GMT time zone it is OK, I get the same time back from
as.POSIXct as I entered
> as.POSIXct(as.numeric(strptime("30/01/2012 13:00:00", format="%d/%m/%Y
>
2008 Dec 09
3
difftime
Hi. I'm trying to take the difference in days between two times. Can
you point out what's wrong, or suggest a different function? When I
try the following code, The following code works fine:
a <- strptime(1911100807,format="%Y%m%d%H",tz="GMT")
b <- strptime(1911102718,format="%Y%m%d%H",tz="GMT")
x <- difftime(b, a,