2017-10-18 12 views
-1

は、私が変換したい変換 "2016-08-28T17:12:41.795Z" を "2016年8月28日17:12:41.795"

data published_at 
0 0.0  2015-11-05T12:55:34.685Z 
1 0.0  2015-11-05T12:55:44.695Z 
2 0.0  2015-11-05T12:56:25.328Z 
3 0.0  2015-11-05T12:56:35.333Z 
4 0.0  2015-11-05T12:56:45.332Z 

日付と時刻の列を持つデータフレームを持っていますあなたのデータフレームがdfと呼ばれている場合は、次の形式に

data published_at 
0 0.0  2015-11-05 12:55:34.685 
1 0.0  2015-11-05 12:55:44.695 
2 0.0  2015-11-05 12:56:25.328 
3 0.0  2015-11-05 12:56:35.333 
4 0.0  2015-11-05 12:56:45.332 
+0

TとZを削除したいだけですか? – zx8754

+0

https://stackoverflow.com/questions/11936339/in-r-replace-text-within-a-stringの可能な複製 – zx8754

+1

[Rでは、文字列内のテキストを置換する](https:// stackoverflow。 com/questions/11936339/in-r-a-string内の置換テキスト) – KoenV

答えて

0

このTを削除し、Zます:これらはちょうどある

gsub("T"," ", df$published_at) 
gsub("Z","", df$published_at) 

に留意されたいです。文字列で日付/タイムスタンプではない

関連する問題