Try this code:
require(ggplot2) df <- data.frame( time = rep(seq(Sys.Date(), len = 3, by = "1 day"), 10), y = rep(1:3, 10, each = 3) + rnorm(30), group = rep(c("x", "y", "z"), 10, each = 3) ) df$time <- factor(format(df$time, format = "%Y-%m-%d")) p <- ggplot(df, aes(x = time, y = y, fill = group)) + geom_boxplot() print(p)

Only with x = factor(time) , ggplot(df, aes(x = factor(time), y = y, fill = group)) + geom_boxplot() + scale_x_date() did not work.
Pre-processing, factor(format(df$time, format = "%Y-%m-%d")) , was necessary for this form of graphics.
source share