我不明白为什么POSIXct在某些时候会返回NA?确切说那天该功能不起作用,这是没有道理的。
@PostConstruct
public void init() {
eventModel = new DefaultScheduleModel();
// Some default events are added here
lazyEventModel = new LazyScheduleModel() {
@Override
public void loadEvents(Date start, Date end) {
Date random = getRandomDate(start);
addEvent(new DefaultScheduleEvent("Lazy Event 1", random, random));
random = getRandomDate(start);
addEvent(new DefaultScheduleEvent("Lazy Event 2", random, random));
}
};
}
润滑工作
> as.POSIXct("201003280501", format = "%Y%m%d%H%M", tz = "CET")
[1] "2010-03-28 05:01:00 CEST"
> as.POSIXct("201003280301", format = "%Y%m%d%H%M", tz = "CET")
[1] "2010-03-28 03:01:00 CEST"
> as.POSIXct("201003280201", format = "%Y%m%d%H%M", tz = "CET")
[1] NA
> as.POSIXct("201003290201", format = "%Y%m%d%H%M", tz = "CET")
[1] "2010-03-29 02:01:00 CEST"
有什么建议吗?
> lubridate::as_datetime("201003280201", format = "%Y%m%d%H%M", tz = "CET")
[1] "2010-03-28 02:01:00"
答案 0 :(得分:0)
我发现这是您从冬季跳到夏季的那一天,因此该小时不存在。