List of usage examples for org.joda.time MutableDateTime millisOfDay
public Property millisOfDay()
Calling a setter on the property will replace the values of milli-of-second, second-of-minute, minute-of-hour and hour-of-day.
From source file:com.xpn.xwiki.criteria.impl.PeriodFactory.java
License:Open Source License
private static MutableDateTime toDayStart(MutableDateTime mdt) { mdt.setMillisOfDay(mdt.millisOfDay().getMinimumValue()); return mdt; }
From source file:org.elasticsearch.license.DateUtils.java
License:Open Source License
public static long endOfTheDay(String date) { try {/*from www. j a va 2 s. c o m*/ // Try parsing using complete date/time format return dateTimeFormatter.parseDateTime(date).getMillis(); } catch (IllegalArgumentException ex) { // Fall back to the date only format MutableDateTime dateTime = dateOnlyFormatter.parseMutableDateTime(date); dateTime.millisOfDay().set(dateTime.millisOfDay().getMaximumValue()); return dateTime.getMillis(); } }