Displaying 20 results from an estimated 10000 matches similar to: "Strptime"
2008 May 08
2
Microseconds for a zoo object?
Hello
I have a string which contains microseconds, can anyone help on
constructing this in to a time object, with the microseconds, that I can
take to a ZOO file?
Thanks
Sean
> UK[1,3]
[1] "17:09:53.824"
> UK[1,1]
[1] "2007-12-11 00:00:00"
> mydates <- paste( substr(UK[,1], 1, 10), UK[,3])
> mydates[1]
[1] "2007-12-11 17:09:53.824"
>
2010 Feb 16
3
converting character vector "hh:mm" to chron or strptime 24 clock time vectors
Hi All,
I am attempting to work with some data from loggers. I have read in a
.csv exported from MS Access that already has my dates and times (in 24
clock format), (with StringsAsFactors=FALSE).
> head(tdata)
LogData date time
1 77.16 2008/04/24 02:00
2 61.78 2008/04/24 04:00
3 75.44 2008/04/24 06:00
4 89.43 2008/04/24
2009 Sep 22
3
how to convert character string with only month and year into date
Dear R helpers.
I am new to plotting time data using R.
wonder how to convert character time info into date in R.
I searched over the web but did not find answer.
the input character string is something like 03_1993 or 03-1993, so the
precision is at month level. I tried the following but failed.
#R code below.
strptime(c("03_1993"),"%m_%Y")
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]
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"
>
2010 Nov 08
2
finding the last day of the month
Dear R Help,
I am trying to get fields showing the last day of each month for a monthly
closing project. In order to find the last day of the previous month, I
subtract the number of days from the current month. For all months my code
works; however, for October, my code doesn't work...it returns
2010-09-*29* instead
of 2010-09-*30*.
format(strptime("2010-10-31",
2010 Mar 18
1
probable timezone confusion with as.yearmon
It looks like a timezone issue, and it's causing confusion to me at least.
My original data:
gmt <-
c("19880101 0000", "19880101 0100", "19880101 0300", "19880101 0400",
"19880101 0500", "19880101 0600")
These were converted to local dates/times with
akst<-strptime(gmt,format="%Y%m%d %H%M")-(3600*9) # because I want
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
2018 Mar 06
0
raster time series statistics
Hi Herry,
This is probably due to a call to strptime (or similar). No, it
doesn't accept %Y-%m as a valid format. Maybe add a constant day to
all the dates as that will work:
dt<-list(ID=seq(1:24),month=rep(formatC(1:12,flag=0,width=2),2),
year=sort(rep(2016:2017,12)))
timelst<-paste(unlist(dt['year']),unlist(dt['month']),"01",sep="-")
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
> |
2008 Apr 23
2
ROracle error at step 1
Hi
I Can't connect to the Oracle database, any tips? Has anybody actually
got ROracle up and running on windows?
>> unable to find an inherited method for function "dbConnect",
for signature "OraDriver"
I can happily connect to the same database through RODBC. Oracle client,
version 9.2 installed, amongst others.
Sean
> library(DBI)
> library(ROracle)
2003 May 29
3
Odd behavior of strptime
The example from the help page for strptime has the following oddity:
> dates <- c("02/27/92", "02/27/92", "01/14/92",
+ "02/28/92", "02/01/92")
> times <- c("23:03:20", "22:29:56", "01:03:30",
+ "18:21:03", "16:56:26")
> x <-
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:
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"
>
2001 Oct 31
4
strptime bug (PR#1155)
## rw1031 Version 1.3.1 (2001-08-31)
## > version
## _
## platform i386-pc-mingw32
## arch x86
## os Win32
## system x86, Win32
## status
## major 1
## minor 3.1
## year 2001
## month 08
## day 31
## language R
## The
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
2012 Jul 23
2
date conversation
Hello,
when I convert a factor like this a=01.10.2009
into a date using b=strptime(a, format="%d. %m. %Y").
It works very well.
But when I try to convert c = 2009/10 into a date using
d=strptime(c, format="%Y/%m")
it doesnt work at all. I get d=NA.
What did I do wrong?
Thank you very much for your help!
best regards
Claudia
2002 Apr 18
1
strptime mysteriously adds a day - 0S-specific: Linux and Windows (so far) (PR#1466)
strptime() mysteriously adds a day to a date, unless the year
is specified. Tested on:
Linux (RedHat 6.0) - R version 1.4.1 and R-devel.
Windows - R version 1.4.1
Bug isn't found on OpenBSD, R version 1.4.1.
Transcript:
R : Copyright 2002, The R Development Core Team
Version 1.4.1 (2002-01-30)
...
> ## BUG:
> ## strptime seems to add a day to the request, unless the year
> ##
2011 Jul 19
2
strange problem with strptime and date variable
Hello all,
I am manipulating a large database with 70,000 records. "strptime" generates
a date variable but R treats some of the values as NA. I attach a simple
example below.
I have spent hours on this problem. Any hint would be greatly appreciated.
Many thanks,
Edwin Sun
# =======start of sample code =============
> x <- c("2005-04-02 19:03:00", "2005-04-03
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