Displaying 20 results from an estimated 10000 matches similar to: "Negative years with strptime?"
2010 Jun 03
1
ISO 8601 Weeks/Years on Windows with strptime
Dear R-help,
I am working on a R package for public health surveillance where the ISO
8601 representation of dates is of importance. Especially, the ISO Week
and ISO Year of a date needs to be extracted. I was quite happy to find
all of this implemented in the "Date" class with appropriate calls to
strptime/format (using e.g. %G and %V).
However, only later I realized that this
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
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"
>
2007 Jun 12
1
Can strptime handle milliseconds or AM/PM?
I'm trying to proess date/time fields from files that were given to me to
analyze.
Any clues what I'm doing wrong with strptime? This seems to fail the same
way under Linux or Windows.
For ?strptime would it make sense to explain %OS3 somewhere besides the
Examples?
> # Why does %OS3 work here?
> format(Sys.time(), "%H:%M:%S")
[1] "16:45:19"
>
2011 Jul 06
1
trouble parsing a date using strptime()
Hi,
I am having a trouble parsing dates using strptime() that I get in the
format of year and week number. The data looks like this "201127" which
means year 2011 and week 27. I would like to graph this using ggplot but
then I get a gap between 201054 and 201101 so I thought I would just easily
convert it.
I tried to use strptime and as.Date and the format string of %Y%W but it
seems
2017 Jan 17
1
strptime("1","%m") returns NA
Hi Frederik,
On Mon, 2017-01-16 at 18:20 -0800, frederik at ofb.net wrote:
> Hi R Devel,
>
> I wrote some code which depends on 'strptime' being able to parse an
> incomplete date, like this:
>
> >
> > base::strptime("2016","%Y")
> [1] "2016-01-14 PST"
>
> The above works - although it's odd that it gives the month
2008 May 22
1
tests/ok-errors.R ## bad infinite recursion
I've come across a handful of tests that
fail at our site. I consider this one the
worst because the process does not return.
The patch below simply bypasss the test,
but the errors in the out file are included
as well. I suspect this is due to more or
tighter ulimits on this system.
But I'm not sure if this is result of
different expectations (kernel/userland) of
what should be done in
2006 Apr 15
1
strptime failure R 2.2.1 (PR#8773)
Full_Name: Bill Hutchison
Version: 2.2.1
OS: Windows XP
Submission from: (NULL) (69.158.121.13)
example(strptime) produces the following error:
Error in strptime(x, "%d%b%Y") : 2 arguments passed to 'strptime' which requires
3
This error occurs wherever strptime is used. It does not occur in 2.2.0
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
2011 Jun 17
1
issue with strptime
Hi everyone,
I have bunch of date and time observations in the format %Y-%m-%d %I %M %S
%p. I used strptime() to read this format. But the problem is some of the
times are in the format of %I %M %p, so for those times, strptime is giving
me NA values.
For example,
strptime(paste("2009-04-08","1:49:47 PM"),format="%Y-%m-%d %I:%M:%S %p")
[1] "2009-04-08
2017 Jan 11
2
bug with strptime, %OS, and "."
On Tue, Jan 10, 2017 at 08:13:21PM -0600, Dirk Eddelbuettel wrote:
>
> On 10 January 2017 at 17:48, frederik at ofb.net wrote:
> | Hi R Devel,
> |
> | I just ran into a corner case with 'strptime'. Recall that the "%OS"
> | conversion accepts fractional seconds:
> |
> | > strptime("17_35_14.01234.mp3","%H_%M_%OS.mp3")$sec
> |
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
2006 Mar 07
3
Applying strptime() to a data set or array
I'm sure this is just the result of a basic misunderstanding of the
syntax of R, but I am stumped.
A <-
read.table(file="sumByThirtyMinute.csv",sep=",",col.names=c("date","pandl"))
A now consists of thousands of rows, but A$date is a string...
...
3183 2006-02-28 12:00:00 548.470
3184 2006-02-28 12:30:00 515.240
3185 2006-02-28 13:00:00
2017 Jan 11
4
bug with strptime, %OS, and "."
Hi R Devel,
I just ran into a corner case with 'strptime'. Recall that the "%OS"
conversion accepts fractional seconds:
> strptime("17_35_14.01234.mp3","%H_%M_%OS.mp3")$sec
[1] 14.01234
Unfortunately for my application it seems to be "greedy", in that it
tries to parse a decimal point which might belong to the rest of the
format:
>
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:
2003 Nov 12
1
value of strptime in R 1.8.0
Dear R-people!
I am using R 1.8.0, under Windows XP.
What I want to do is a date conversion of a character column of a data frame
and assign the result as a new column.
Simple example:
> x <- data.frame(a=c("yesterday","today","tomorrow"), b=I(c("20031111",
"20031112", "20031113")))
# convert x$b from character to date:
>
2001 Jan 11
2
problem with strptime example (PR#811)
On Thu, 11 Jan 2001 stephen@anc.ed.ac.uk wrote:
> Hi,
>
> The help file for strptime has the following code which doesn't work
> for me:
>
> ## read in date info in format `ddmmmyyyy'
> x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960")
> z <- strptime(x, "%d%b%Y")
> > z
> [1]
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
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
2009 Aug 09
1
Why is strptime always returning a vector of length 9 ?
Dear List,
I am having an issue with strptime (see below).
I can reproduce it on R-2.8, R-2.9, and R-2.10-dev, I tempted to see
either a bug or my misunderstanding (and then I just don't currently see
where).
# setup:
x <- c("March 09, 2007", "May 31, 2007", "November 12, 2008", "November
12, 2008", "July 30, 2009", "July 30,