Example usage for org.joda.time MutableDateTime millisOfDay

List of usage examples for org.joda.time MutableDateTime millisOfDay

Introduction

In this page you can find the example usage for org.joda.time MutableDateTime millisOfDay.

Prototype

public Property millisOfDay() 

Source Link

Document

Get the millis of day property

Calling a setter on the property will replace the values of milli-of-second, second-of-minute, minute-of-hour and hour-of-day.

Usage

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();
    }
}