Displaying 20 results from an estimated 10000 matches similar to: "strptime and strftime"
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
2010 Oct 29
2
strftime vs strptime ??
Hello
Could anyone explain me the difference between strftime vs strptime, please
?
I've read the help but it's a little bit cionfusing for me.
cheers
--
View this message in context: http://r.789695.n4.nabble.com/strftime-vs-strptime-tp3018865p3018865.html
Sent from the R help mailing list archive at Nabble.com.
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 <-
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
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.
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
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
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 =>
2012 Oct 03
3
"options" in R
Dear Rxperts,
Was wondering if there is any function in R similar to
options("time.zone"): found in S-Plus that can help in looking at the
default timezone settings..
Thanks much,
Santosh
[
[[alternative HTML version deleted]]
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
2008 Mar 27
2
strptime and plot(),lines()
Hello,
Im reading Data out of a Database.
#v+
rs <- dbGetQuery(con,"SELECT * ... )
attach(rs)
#v-
There ist a colum I convert into "Time".
#v+
> zeit<-strptime(datum,format="%Y-%m-%d %H:%M:%S");
> class(zeit)
[1] "POSIXt" "POSIXlt"
#v-
1.
A plot(zeit,money) plots the Data.
All i see on the x-achis are the Days.
I would like to see the
2012 Nov 05
1
Dates as POSIXt
When I try to do linear interpolation between financial contracts with maturities on different dates in different months I have come across some behavior I haven't seen before.
I have a data frame in R which is loaded from an access database so I can't provide a working example. It was loaded using this code:
> dbPath <- "H:/pathToDB/DB.mdb"
> channel <-
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
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")
2016 Apr 11
2
Query about use of format in strptime
Dear Jim and dear Enrico,
thank you for your replies.
Unfortunately your hints didn't solve my problem, and I am getting mad.
Can I show you my whole process? I will be as quick as possible.
I start from a data frame called Snow of the form
year month day hh mm hs
2007 11 19 0 0 0.00
2007 11 19 0 30 0.00
2007 11 19 1 0 0.00
2007 11 19 1 30 0.00
2007 11 19 2 0 0.00
2007 11 19 2 30 0.00
2007 11
2010 Mar 19
2
strptime(): on Linux system it seems to call system time?
[I am herewith re-posting this message on R-devel, as it seems to be the
most appropriate mailing list for this issue.]
Dear List,
>From what I understand, strptime() simply converts from one class
representation to another; i.e., from character to POSIXct/POSIXlt.
One strange feature of this command running on Linux is that there are
repeated calls to system time (as was revealed
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
--------------------
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 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
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