There is also a nice function in the base package, to categorize each date to year, month, week, day and so on. You can then use these columns for any aggregation you like.
df=data.frame(
DateTime=as.POSIXct(c("2030-01-01 01:00:00","2030-01-01 01:15:00",
"2030-01-01 01:15:00","2030-01-01 02:15:00",
"2030-01-01 03:15:00","2030-01-01 03:15:00",
"2029-03-02 04:15:00","2028-04-12 09:15:00")),
temperature=c(10,15,2,10,5,6,18,21))
df
df$year <- strftime(df$DateTime, "%Y")
df$month <- strftime(df$DateTime, "%m")
df$day <- strftime(df$DateTime, "%d")
df$week <- strftime(df$DateTime, "%V")
df$hour <- strftime(df$DateTime, "%H")