Re: [R] Default Format for Dates?

From: Roger D. Peng <rpeng_at_jhsph.edu>
Date: Sat 11 Jun 2005 - 04:31:11 EST

Is something like this what you want?

x <- as.Date("2003-06-24")
format(x, "%B %d %Y")

or perhaps

as.character(x, "%B %d %Y")

-roger

khobson@fd9ns01.okladot.state.ok.us wrote:
>
>
>
> Is there anyway to preset date formats? I have a date from a cover.dbf
> that is shown as this:
>

>>cover$FINALREPOR

>
> [1] "2003-06-24"
>
> The numeric value in cover$FINALREPOR is 12227. I'd rather not create
> another vector to hold the properly formatted date.
>
> When I put this in a WordPerfect merge, I want the date to be June 24,
> 2003. I could take care of the problem in a WordPerfect macro but I'd
> rather do it as an R default date format if possible.
>
> I researched some of this in the archives, FAQ's and manuals but didn't
> find anything that met my need. I would imagine that this type of question
> is probably an FAQ but I didn't find it.
>
> mailto:khobson@odot.org
> Kenneth Ray Hobson, P.E.
> Oklahoma DOT - QA & IAS Manager
> 200 N.E. 21st Street
> Oklahoma City, OK 73105-3204
> (405) 522-4985, (405) 522-0552 fax
>
> Visit our website at:
> http://www.okladot.state.ok.us/materials/materials.htm
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
-- 
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sat Jun 11 04:35:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:30 EST