Re: : strptime bug

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

Re: : strptime bug

Georgi Boshnakov
Hi,

You don't give the time zone but this is probably due to the clock jumping by one hour when switching to summer time. In UK this happens at 1am and on that day there is no such thing as 01:05, etc.,  see eg https://www.timeanddate.com/time/change/uk/london
In your time zone this probably happens at 2am.

Georgi Boshnakov

------------------------------

Message: 7
Date: Thu, 26 Jan 2017 11:02:06 +0100
From: rob vech <[hidden email]>
To: [hidden email]
Subject: [Rd] strptime bug
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="UTF-8"

Dear developer list,
I want to submit the following problem that seems like a bug, as confirmed by an other user [1], related to date-time parsing:
Here a simple script:

# that works:
as.numeric(as.POSIXlt(strptime('2016-03-27 01:05:50', format='%Y-%m-%d
%H:%M:%S')))

# that not (it returns NA):
as.numeric(as.POSIXlt(strptime('2016-03-27 02:05:50', format='%Y-%m-%d
%H:%M:%S')))

# it works again
as.numeric(as.POSIXlt(strptime('2016-03-27 03:05:50', format='%Y-%m-%d
%H:%M:%S')))

I made several test and the problem seems to be related to the couple "2016-03-27" as date and "2" as hour. It seems not to be related to the datetime format.

There is a similar bug on bugzilla [2] but in my case I cannot replicate it.

My OS is Win 7 and R v3.3.2.

Thank you

rob


[1] https://stat.ethz.ch/pipermail/r-help/2017-January/444468.html

[2] https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16764


        [[alternative HTML version deleted]]



------------------------------

Subject: Digest Footer

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

------------------------------

End of R-devel Digest, Vol 167, Issue 23

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

Re: : strptime bug [no more!]

rob vech
Thank you Georg!
It definitely resolves the problem!
Adding the correct time zone (tz='GMT') returns a valid number as my
data are in solar time.
rob

        [[alternative HTML version deleted]]

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