My question takes a general aspect comparing to which was proposed here How to remove time-field string from a date-as-character variable?.
In fact, suppose I have this date type variable:
> head(DataDia$Date)
[1] "2016-09-13 15:56:30.827" "2016-12-12 13:39:17.537" "2016-09-16 21:57:24.977" "2016-09-23 11:19:22.010"
[5] "2017-01-11 20:06:58.490" "2016-10-21 23:40:43.927"
How do I delete all time-field strings and just keep the date format. SO that I get this:
> head(DataDia$Date)
[1] "2016-09-13" "2016-12-12" "2016-09-16" "2016-09-23"
[5] "2017-01-11" "2016-10-21"
Note please that I am working on a data table. So I need a way using data.table operations.