This commit is contained in:
Redkale
2018-05-03 09:52:50 +08:00
parent f712107fb8
commit a34218367b

View File

@@ -6,6 +6,7 @@
package org.redkale.source;
import java.util.function.*;
import org.redkale.util.Utility;
/**
*
@@ -195,6 +196,16 @@ public interface Range<E extends Comparable> extends java.io.Serializable, Predi
if (max != null) this.max = max;
}
public static LongRange todayRange() {
long min = Utility.midnight();
return new LongRange(min, min + 24 * 60 * 60 * 1000 - 1);
}
public static LongRange yesterdayRange() {
long min = Utility.midnight(System.currentTimeMillis() - 24 * 60 * 60 * 1000);
return new LongRange(min, min + 24 * 60 * 60 * 1000 - 1);
}
@Override
public Long getMin() {
return min;