JodaTime - Check if LocalTime is after now and now before another LocalTime

后端 未结 2 1884
忘了有多久
忘了有多久 2021-01-20 03:27

I am trying to check if the currenttime is after a startLocalTime and before another endLocalTime which is the start time plus 11 hours. This works

2条回答
  •  半阙折子戏
    2021-01-20 04:18

    LocalTime is exactly that – a time.
    It doesn't store a date, so your question is fundamentally impossible.

    If you want to count hours as they wrap around days, you need to get a date as well, and you need to beware of DST.

提交回复
热议问题