[R] Convert time format to character

Peter Alspach Peter.Alspach at plantandfood.co.nz
Tue Nov 4 03:01:55 CET 2014


Tena koe

For example:

myTime <- Sys.time()
myTime
[1] "2014-11-04 14:58:10 NZDT"
format(myTime, '%Y%m%d:%H%M%S')
[1] "20141104:145810"

My information in ?strptime.

HTH ....

Peter Alspach

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of TJUN KIAT TEO
Sent: Tuesday, 4 November 2014 11:10 a.m.
To: r-help at r-project.org
Subject: [R] Convert time format to character

Suppose I have a object in time format

2014-08-13 00:30:00

I want to convert it to a character string 20140813003000

Is is possible ?

Tjun Kiat
 		 	   		  
	[[alternative HTML version deleted]]

______________________________________________
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.
The contents of this e-mail are confidential and may be ...{{dropped:14}}



More information about the R-help mailing list