本文整理了Java中java.sql.Time.before()
方法的一些代码示例,展示了Time.before()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Time.before()
方法的具体详情如下:
包路径:java.sql.Time
类名称:Time
方法名:before
暂无
代码示例来源:origin: org.jumpmind.symmetric/symmetric-core
public boolean inTimeWindow(Time time) {
if (enabled) {
return (startTime.before(time) && endTime.after(time))
|| (startTime.before(time) && endTime.before(startTime))
|| (endTime.after(time) && startTime.after(endTime));
} else {
return true;
}
}
代码示例来源:origin: org.brunocvcunha.inutils4j/inutils4j
/**
* Tells you if the date part of a datetime is in a certain time range.
*/
@SuppressWarnings("deprecation")
public static boolean isTimeInRange(java.sql.Time start, java.sql.Time end, java.util.Date d) {
d = new java.sql.Time(d.getHours(), d.getMinutes(), d.getSeconds());
if (start == null || end == null) {
return false;
}
if (start.before(end) && (!(d.after(start) && d.before(end)))) {
return false;
}
if (end.before(start) && (!(d.after(end) || d.before(start)))) {
return false;
}
return true;
}
代码示例来源:origin: com.jalalkiswani/jk-util
if (timeFrom.after(otherTimeFrom) && timeFrom.before(otherTimeTo)) {
return true;
if (timeTo.after(otherTimeFrom) && timeTo.before(otherTimeTo)) {
return true;
if (timeFrom.before(otherTimeFrom) && timeTo.after(otherTimeTo)) {
return true;
代码示例来源:origin: org.patterntesting/patterntesting-rt
/**
* Checks if the given range matches the actual time. If midnight is int the
* given range like "22:00-4:00" it is splitted into two parts,
* "22:00-24:00" and "0:00"-"4:00" and then checked.
*
* @param fromTo
* the from to
* @return true, if is time in rage
*/
private static boolean isTimeInRage(final String fromTo) {
String[] range = fromTo.split("-");
Time t1 = Converter.toTime(range[0]);
Time t2 = Converter.toTime(range[1]);
String from = t1.toString();
String to = t2.toString();
if (t2.before(t1)) {
String beforeMidnight = t1 + "-24:00";
String afterMidnight = "0:00-" + t2;
return isTimeInRage(beforeMidnight) || isTimeInRage(afterMidnight);
}
if ("00:00:00".equals(to)) {
to = "24:00:00";
}
Time tnow = new Time(System.currentTimeMillis());
String now = tnow.toString();
return (now.compareTo(from) >= 0) && (now.compareTo(to) <= 0);
}
代码示例来源:origin: apache/ofbiz-framework
if (!timeVal.equals(nowTime)) {
if (isBeforeNow) {
if (timeVal.before(nowTime)) {
return true;
内容来源于网络,如有侵权,请联系作者删除!