Package org.joda.time

Examples of org.joda.time.Hours


     *         days)
     */
    public static int hoursInDay(final DateTime dt) {
        final DateTime dt0 = dt.withMillisOfDay(0); // Set to start of day
        final DateTime dt1 = dt0.plusDays(1); // Set to end of day
        final Hours hours = Hours.hoursBetween(dt0, dt1);
        return hours.getHours();
    }
View Full Code Here


     * @return
     */
    public static Integer getHoursBetweenDates(final Date startDate){
        final DateTime currentDate = new DateTime();
        final DateTime storedDate = new DateTime(startDate);
        final Hours hoursBetween = Hours.hoursBetween(storedDate, currentDate);
        return hoursBetween.getHours();
    }
View Full Code Here

TOP

Related Classes of org.joda.time.Hours

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.