try this: > x <- c('1/1/1970','12/13/2010', '2/3/2001') > gsub("(\\d+/\\d+/)\\d\\d(\\d\\d <file://d+///d+/)//d//d(//d//d>)", > "\\1\\2<file://0.0.0.1//2>", x) [1] "1/1/70" "12/13/10" "2/3/01"
On Tue, Mar 23, 2010 at 10:10 AM, Hosack, Michael <mhos...@state.pa.us>wrote: > 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@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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]] ______________________________________________ R-help@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.