[英]Date time conversion in R from datetime format to datemonth
I have two columns in R which are like: 我在R中有两列,例如:
2004-07-08 14:30:00 12.41
Now, I want to transform the first column that is the date time column to datemonth column only. 现在,我想将第一列即日期时间列转换为仅日期月列。 like: 喜欢:
8 July 12.41
Any suggestions? 有什么建议么?
We can use format
我们可以使用format
format(as.POSIXct(str1), '%d %B')
#[1] "08 July"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.