HI, May be this helps: MyString1 <- c("Sun Sep 01 00:20:00 EDT 2013", "Sun Dec 01 00:00:00 EST 2013") as.POSIXct(gsub("EDT|EST","",MyString1), format="%a %b %d %H:%M:%S %Y") #[1] "2013-09-01 00:20:00 EDT" "2013-12-01 00:00:00 EST" as.Date(gsub("EDT|EST","",MyString1), format="%a %b %d %H:%M:%S %Y") #[1] "2013-09-01" "2013-12-01"
A.K. ----- Original Message ----- From: Ron Michael <ron_michae...@yahoo.com> To: "r-help@r-project.org" <r-help@r-project.org> Cc: Sent: Sunday, August 4, 2013 11:34 AM Subject: [R] Converting string to date Hi, I want to convert following string to a Date format (mm/dd/yyyy): MyString <- c("Sun Sep 01 00:00:00 EDT 2013", "Sun Dec 01 00:00:00 EST 2013") Can somebody point me if it is possible to do that? Thank you. ______________________________________________ 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. ______________________________________________ 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.