Examples of dateNow()


Examples of org.threeten.bp.chrono.Chronology.dateNow()

    }

    private static void newPackagePluggable() {
        Chronology chrono = MinguoChronology.INSTANCE;

        ChronoLocalDate date = chrono.dateNow();
        System.out.printf("now: %s%n", date);

        date = date.with(DAY_OF_MONTH, 1);
        System.out.printf("first of month: %s%n", date);
View Full Code Here

Examples of org.threeten.bp.chrono.Chronology.dateNow()

     * Prints a Minguo calendar for the current month.
     */
    private static void printMinguoCal() {
        String chronoName = "Minguo";
        Chronology chrono = Chronology.of(chronoName);
        ChronoLocalDate today = chrono.dateNow();
        printMonthCal(today, System.out);
    }

    /**
     * Print a month calendar with complete week rows.
View Full Code Here

Examples of org.threeten.bp.chrono.Chronology.dateNow()

     * Compute the number of days from the Epoch and compute the date from the number of days.
     */
    @Test(dataProvider = "calendars")
    public void test_epoch(String name, String alias, String description) {
        Chronology chrono = Chronology.of(name); // a chronology. In practice this is rarely hardcoded
        ChronoLocalDate date1 = chrono.dateNow();
        long epoch1 = date1.getLong(ChronoField.EPOCH_DAY);
        ChronoLocalDate date2 = date1.with(ChronoField.EPOCH_DAY, epoch1);
        assertEquals(date1, date2, "Date from epoch day is not same date: " + date1 + " != " + date2);
        long epoch2 = date1.getLong(ChronoField.EPOCH_DAY);
        assertEquals(epoch1, epoch2, "Epoch day not the same: " + epoch1 + " != " + epoch2);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.