```
    hourlyCalories <- hourlyCalories_merged[,c(1,2,3)] %>%
    separate("ActivityHour", into = c("Date", "Hour", "AM_PM"), sep = " ") %>% 
    unite("ActivityHour", "Hour", "AM_PM", sep = " ")

    Id      Date ActivityHour Calories
    1   1503960366 4/12/2016  12:00:00 AM       81
    2   1503960366 4/12/2016   1:00:00 AM       61
    3   1503960366 4/12/2016   2:00:00 AM       59
    4   1503960366 4/12/2016   3:00:00 AM       47

```

**Below is the code I tried, but it would return NA, could you please help how to convert them to date?**

```
hourlyCalories %>%
mutate("ActivityHour"=as.Date("ActivityHour", format = "%I:%M:%S %p"))

 Id      Date ActivityHour Calories
 1   1503960366 4/12/2016         NA       81
 2   1503960366 4/12/2016         NA       61
 3   1503960366 4/12/2016         NA       59
 4   1503960366 4/12/2016         NA       47

```