如何在Excel / SQL / R中将具有两种不同日期格式的日期列标准化为具有单一日期格式的列

时间:2018-12-15 06:49:22

标签: r excel

我的数据中有一个日期列,具有两种不同类型的格式。有什么方法可以标准化日期列,使其只有一种类型的日期格式?

样本输入数据:

enter image description here

所需的输出数据

enter image description here

1 个答案:

答案 0 :(得分:3)

在R中,您可以使用 <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/LaunchScreenTheme"> 库进行相同类型的转换。

anytime

这会将其转换为您所在区域的时间。

数据

library(anytime) 
anytime(x)

#[1] "2010-12-01 08:26:00 +08" "2010-12-01 08:26:00 +08" "2010-12-01 08:26:00 +08" 
#    "2011-02-17 11:05:00 +08" "2011-02-17 11:05:00 +08"