[R] formating chron date times for printing

stephen sefick ssefick at gmail.com
Tue Jun 29 20:01:58 CEST 2010

the date were created with chron with this argument

format=c(dates="Y/m/d", times="H:M:S"))

so I have the dates being displayed as

(10/06/22 12:00:00)

I would like to have them displayed as

"2010-06-22 12:00:00" or "%Y-%m-%d %H:%M:%S"

and then I can convert these for mergeing with another data frame

x <- (structure(c(14464, 14464.0104166667, 14464.0208333333, 14464.03125,
14464.0416666667), format = structure(c("Y/m/d", "H:M:S"), .Names = c("dates",
"times")), origin = c(1, 1, 1970), class = c("chron", "dates",

reading through old posts I found this:

format(x, enclosed = c("", ""))

which put the which surrounds the date time with "" instead of ()
now I would like to change the format of the dates to print like the
above specified.
kindest regards,

Stephen Sefick
| Auburn University                                   |
| Department of Biological Sciences           |
| 331 Funchess Hall                                  |
| Auburn, Alabama                                   |
| 36849                                                    |
| sas0025 at auburn.edu                             |
| http://www.auburn.edu/~sas0025             |

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

								-K. Mullis

More information about the R-help mailing list