我有一个有4个字段的表,分别是startdate、enddate、starttime和endtime。我需要像这样设置谓词
if
startdate<= currentdate and currentdate <= enddate
if
starttime <= currenttime and endtime <= endtime
else
starttime <= currenttime and currenttime<= 23.00 or 0.00 <= currentime and currentime
当我转换为毫秒时,时间会显示不同日期的不同时间,。如何为当前日期生成相同的时间。
代码:
final Random random = new Random();
for (int i = 0; i < 10; i++) {
final LocalTime time = new LocalTime(random.nextLong());
System.out.println(time);
}
提前谢谢。
目标
使用ggplot2::scale_*_time以特定的方式格式化时间轴(使用最新版本的ggplot2)。
极小Reprex
# Example data
tib1 <- tibble::tibble(
x = 1:10,
y = lubridate::as.duration(seq(60, 600, length.out = 10))
)
与ggplot2::scale_*_time一起使用format = "%R"不起作用--轴是用%H:%M:%S格式化的
# This doesn't work
ggplot2::ggplot(tib1)