On May 16, 2013, at 10:43 AM, Dominic Roye wrote:
> Hello,
>
> I'm a little surprised about the result of strftime for my data.
>
>> str(time)
> chr [1:315504] "2006-01-01 00:10:00" "2006-01-01 00:20:00" "2006-01-01
> 00:30:00" ...
>
>> str(strftime(time,format="%Y-%m-%d %H:%M:%S"))
> chr [1:3
Hello,
I'm a little surprised about the result of strftime for my data.
> str(time)
chr [1:315504] "2006-01-01 00:10:00" "2006-01-01 00:20:00" "2006-01-01
00:30:00" ...
> str(strftime(time,format="%Y-%m-%d %H:%M:%S"))
chr [1:315504] "2006-01-01 00:00:00" "2006-01-01 00:00:00" "2006-01-01
00:00
I think you are using the wrong function. See ?strftime
Try
dataset=c("1/2/1978")
strptime(dataset,"%d/%m/%Y")
John Kane
Kingston ON Canada
> -Original Message-
> From: rrast...@gmail.com
> Sent: Fri, 3 Feb 2012 14:34:09 +0100
> To: r-help@r-project.org
On 02/03/2012 03:34 PM, Ana wrote:
> 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:
>
> dat
On Fri, 3 Feb 2012, Ana wrote:
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:
So use as.Date to convert
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/0
On Oct 29, 2010, at 6:55 AM, skan wrote:
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.
You should focus on the "Value" section of the help page. They return
vectors of different classes.
strptime() takes a character vector and makes a date-time object.
That is input.
strftime() takes a date-time object and makes an character vector.
That is output, and it is normally called via format() or print().
Let's see what the help says (slightly edited to refer just to these
two):
Da
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
9 matches
Mail list logo