Displaying 20 results from an estimated 7000 matches similar to: "strftime vs strptime ??"
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
2008 Oct 29
1
strptime and strftime
Dear R experts..
I am trying to understand what exactly strptime and strftime do...
Where can I look for the detailed notes on these two functions? In addition,
how POSIX functions like POSIXct and POSIXlt are used in these functions?
Regards,
Santosh
[[alternative HTML version deleted]]
2012 Feb 03
3
strftime - Dates from Excel files
Hi
I have many excel files were the Date field was not declared as date,
so the dates look like this: 1/2/1978
I know that the format is day/month/year
How can I make R change this to Date format?
If I use strftime, I get wrong dates:
dataset=c("1/2/1978")
strftime(dataset,"%d/%m/%Y")
"19/02/0001"
Thanks in advance.
2008 Feb 04
1
strftime fails on POSIXct objects (PR#10695)
R 2.6.1 on a Thinkpad T60 running up-to-date Gentoo:
Despite the documentation, which says:
'strftime' is an alias for 'format.POSIXlt', and 'format.POSIXct'
first converts to class '"POSIXlt"' by calling 'as.POSIXlt'. Note
that only that conversion depends on the time zone.
strftime fails on POSIXct objects:
> foo <-
2016 Apr 11
3
Query about use of format in strptime
Dear R-list users,
I need to use strptime because I have to deal with date with hours and minutes.
I read the manual for strptime and I also looked at many examples, but when I try to apply it to my code, I always encounter some problems.
I try to change the default format, with no success. Why? How can I change the format?
1.
init_day <- as.factor("2015-02-24-00-30")
2007 Oct 08
2
asterisk hangs on STRPTIME
hello,
running asterisk 1.4.11 on CentOS 4.5
I am getting no response on function STRPTIME() the system just hangs,
STRFTIME() is working fine as seen below. Same thing happens whether
I called in from a softphone or via teliax.
While executing the following code :
;
exten => s,n,Set(v_ts=)
exten => s,n,Set(v_ts=${STRFTIME(|America/New_York|%Y-%m-%d)})
exten =>
2009 Sep 20
2
Date/Time to date & time
Hi,
Can strptime (or some other function) help me turn the following
column of a data.frame into two new columns, one as date and the other
as time, preserving the AM/PM value?
Thanks,
Mark
> B
ENTRY DATE
1 3/23/2009 6:30:00 AM
2 3/23/2009 6:30:00 AM
3 3/23/2009 6:39:00 AM
4 3/23/2009 6:39:00 AM
5 3/23/2009 6:48:00 AM
6 3/23/2009 6:48:00 AM
7 3/23/2009 7:00:00 AM
2010 Aug 16
2
when to use textConnection ??
Hello.
I don't uderstant when to use textConnection and when not.
Some examples do it, some not.
I've even seen something like
con <- textConnection(rev(rev(ReadLines('data.txt'))[-(1:2]))
data <- read.table(con)
close(con)
--
View this message in context: http://r.789695.n4.nabble.com/when-to-use-textConnection-tp2327132p2327132.html
Sent from the R help mailing list
2012 Feb 22
4
Week number from a date
Hi
My data looks like this
startDate="2008-06-01"
dateRange =c( "2008-10-01","2008-12-01")
Is there any method to find the week number from the startDate range
-----
Thanks in Advance
Arun
--
View this message in context: http://r.789695.n4.nabble.com/Week-number-from-a-date-tp4410223p4410223.html
Sent from the R help mailing list archive at Nabble.com.
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
2003 Nov 26
4
strptime Usage
Hi,
I have a column in a dataframe in the form of:
> as.vector(SLDATX[1:20])
[1] "1/6/1986" "1/17/1986" "2/2/1986" "2/4/1986" "2/4/1986"
[6] "2/21/1986" "3/6/1986" "3/25/1986" "4/6/1986" "4/10/1986"
[11] "4/23/1986" "4/30/1986" "5/8/1986"
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
2008 Dec 11
3
getting ISO week
Hi all,
Is there a simple function already implemented for getting the ISO
weeks of a Date object?
I couldn't find one, and so wrote my own function to do it, but would
appreciate a pointer to the "default" way. If a function is not yet
implemented, could the code below be of interest to submit to CRAN?
Best Regards,
Gustaf
--------------------
2008 Jul 09
4
Strptime/ date time classes
Dear all,
I've come across a problem using strptime, can anyone explain what's
going on? I'm using version 2.7.0 on Windows XP.
Thank you
Caroline
First read in a data file using read.table
alldata = read.table(file, header=F, skip=4, colClasses =
c("character","numeric"))
dim(alldata)
[1] 223960 2
# inefficient, safe way of sorting out missing or dodgy
2002 Feb 26
2
last day of month values
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have a stock market trading values time series. What's the best way to
extract the "last day of month" values. I looked at function window() but
doesn't appear suitable for this since it expects regular dates.
Thank you.
lukas
- --
Lukas Kubin
lukas.kubin at permonik.com
phone: 00420603836180
-----BEGIN PGP SIGNATURE-----
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
> |
2004 Nov 30
4
Unable to understand strptime() behaviour
R V2.0.1 on Windows XP.
I have read the help pages on strptime() over and over, but can't
understand why strptime() is producing the following results.
> v <- format("2002-11-31", format="%Y-%m-%d")
> v
[1] "2002-11-31"
> factor(v, levels=v)
[1] 2002-11-31
Levels: 2002-11-31
> x <- strptime("2002-11-31",
2004 May 06
3
strptime
Delving into the murky world of dates and times I found this:
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 <- paste(dates, times)
> z <- strptime(x, "%m/%d/%y
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 <-
2013 Jan 17
1
Can strptime handle milliseconds or AM/PM?
Readers,
Responding to an old post
(http://tolstoy.newcastle.edu.au/R/e2/help/07/06/18850.html), and
using the example in the manual:
monthextract<-strptime("20/2/06 11:16:16.683", "%m")
monthextract
[1] NA
Why is the result 'NA' and not '2'?
--
r2151