Package hirondelle.date4j

Examples of hirondelle.date4j.DateTime$ItemOutOfRange


    /**
     * Format using ISO style.
     */
    public static void imitateISOFormat () {
        DateTime now = DateTime.now( TimeZone.getDefault() );
        log( "Output using an ISO format: " + now.format( "YYYY-MM-DDThh:mm:ss" ) );
    }
View Full Code Here


        DateTime now = DateTime.now( TimeZone.getDefault() );
        log( "Output using an ISO format: " + now.format( "YYYY-MM-DDThh:mm:ss" ) );
    }

    public static void firstDayOfThisWeek () {
        DateTime today = DateTime.today( TimeZone.getDefault() );
        DateTime firstDayThisWeek = today; //start value
        int todaysWeekday = today.getWeekDay();
        int SUNDAY = 1;
        if ( todaysWeekday > SUNDAY ) {
            int numDaysFromSunday = todaysWeekday - SUNDAY;
            firstDayThisWeek = today.minusDays( numDaysFromSunday );
View Full Code Here

    /**
     * For how many years has the JDK date-time API been suctorial?
     */
    public static void jdkDatesSuctorial () {
        DateTime today = DateTime.today( TimeZone.getDefault() );
        DateTime jdkFirstPublished = DateTime.forDateOnly( 1996, 1, 23 );
        int result = today.getYear() - jdkFirstPublished.getYear();
        log( "The number of years the JDK date-time API has been suctorial : " + result );
    }
View Full Code Here

TOP

Related Classes of hirondelle.date4j.DateTime$ItemOutOfRange

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.