java - How to check if a certain period of time passes an exact timestamp? -
How do I check that the time period (together with two temporary timelines (start and end) passes for example midnight ?
I am trying to use the local Dat Time class, but there can not be anything useful ..
It is best that I can come up with it:
public static boolean pass time (Local Datetime startup , Localized time, local time time) {// If the period is more than one day, any time will be passed (period. (Between, start, end) .toDays ()> = 1) return true; // Otherwise, Time is to be passed on the start day ... local datetime timeOnstartDay = localDatetime (start.TolocateDate), time); if (timeOnDARTDAY. Later (start) & timeOnDrartData.First (end)) Come true; // local datetime tu on the last day Mondedy = Lokldettaim. (End. Tulokl date), time); If (time induced. Indirectly (start) and timeanded. Before (end)) is true; return false; } java.time tested with the API. If you are using Joda then the code should be the same (if not equal).
Comments
Post a Comment