本文整理匯總了Java中org.joda.time.MutableDateTime.setMillisOfDay方法的典型用法代碼示例。如果您正苦於以下問題:Java MutableDateTime.setMillisOfDay方法的具體用法?Java MutableDateTime.setMillisOfDay怎麽用?Java MutableDateTime.setMillisOfDay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.joda.time.MutableDateTime
的用法示例。
在下文中一共展示了MutableDateTime.setMillisOfDay方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLowerDateTimeBound
import org.joda.time.MutableDateTime; //導入方法依賴的package包/類
public static DateTime getLowerDateTimeBound(String dateRange) throws ParseException {
Range range = SearchExpressionUtils.parseRange(dateRange);
if (range == null) {
throw new IllegalArgumentException("Failed to parse date range from given string: " + dateRange);
}
if (range.getLowerBoundValue() != null) {
java.util.Date lowerRangeDate = null;
try{
lowerRangeDate = CoreApiServiceLocator.getDateTimeService().convertToDate(range.getLowerBoundValue());
}catch(ParseException pe){
GlobalVariables.getMessageMap().putError("dateFrom", RiceKeyConstants.ERROR_CUSTOM, pe.getMessage());
}
MutableDateTime dateTime = new MutableDateTime(lowerRangeDate);
dateTime.setMillisOfDay(0);
return dateTime.toDateTime();
}
return null;
}
示例2: getUpperDateTimeBound
import org.joda.time.MutableDateTime; //導入方法依賴的package包/類
public static DateTime getUpperDateTimeBound(String dateRange) throws ParseException {
Range range = SearchExpressionUtils.parseRange(dateRange);
if (range == null) {
throw new IllegalArgumentException("Failed to parse date range from given string: " + dateRange);
}
if (range.getUpperBoundValue() != null) {
java.util.Date upperRangeDate = null;
try{
upperRangeDate = CoreApiServiceLocator.getDateTimeService().convertToDate(range.getUpperBoundValue());
}catch(ParseException pe){
GlobalVariables.getMessageMap().putError("dateCreated", RiceKeyConstants.ERROR_CUSTOM, pe.getMessage());
}
MutableDateTime dateTime = new MutableDateTime(upperRangeDate);
// set it to the last millisecond of the day
dateTime.setMillisOfDay((24 * 60 * 60 * 1000) - 1);
return dateTime.toDateTime();
}
return null;
}