[R] Converting date format

Nutter, Benjamin NutterB at ccf.org
Tue Mar 23 15:16:17 CET 2010


If x is your vector of character date variables:

orig.date <- as.Date(x, format=c("%m/%d/%Y"))
new.date <- format(x, format=c("%m/%d/%y"))

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Hosack, Michael
Sent: Tuesday, March 23, 2010 10:11 AM
To: R-help at r-project.org
Subject: [R] Converting date format

R community:

Hello, I would to like to convert a character date variable from
%m/%d/%Y to %m/%d/%y. Any advice would be greatly appreciated. I have
tried functions for changing the formatting and removing the unnecessary
digits without success.

Mike

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


===================================

P Please consider the environment before printing this e-mail

Cleveland Clinic is ranked one of the top hospitals
in America by U.S.News & World Report (2009).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use\...{{dropped:13}}



More information about the R-help mailing list