Package org.threeten.bp.format

Examples of org.threeten.bp.format.DateTimeFormatter.format()


            .appendValue(MONTH_OF_YEAR)
            .appendLiteral(')')
            .appendLiteral(' ')
            .appendValue(DAY_OF_MONTH, 2)
            .toFormatter(Locale.ENGLISH);
        String formatted = f.format(resolved);
        System.out.println("...printed using complex format: " + formatted);

        MonthDay bday = MonthDay.of(DECEMBER, 3);
        System.out.println("Brazillian birthday (no year): " + bday);
    }
View Full Code Here


    }

    private static void print1() {
        DateTimeFormatter f = new DateTimeFormatterBuilder().appendText(ChronoField.AMPM_OF_DAY)
                .appendLiteral(' ').appendValue(ChronoField.AMPM_OF_DAY).toFormatter();
        System.out.println(f.format(LocalTime.of(12, 30)));
        System.out.println(f.format(ZonedDateTime.now()));
    }

    private static void print2() {
        DateTimeFormatter f = new DateTimeFormatterBuilder().appendText(ChronoField.MONTH_OF_YEAR)
View Full Code Here

    private static void print1() {
        DateTimeFormatter f = new DateTimeFormatterBuilder().appendText(ChronoField.AMPM_OF_DAY)
                .appendLiteral(' ').appendValue(ChronoField.AMPM_OF_DAY).toFormatter();
        System.out.println(f.format(LocalTime.of(12, 30)));
        System.out.println(f.format(ZonedDateTime.now()));
    }

    private static void print2() {
        DateTimeFormatter f = new DateTimeFormatterBuilder().appendText(ChronoField.MONTH_OF_YEAR)
                .appendLiteral(' ').appendValue(ChronoField.YEAR).toFormatter();
View Full Code Here

    }

    private static void print2() {
        DateTimeFormatter f = new DateTimeFormatterBuilder().appendText(ChronoField.MONTH_OF_YEAR)
                .appendLiteral(' ').appendValue(ChronoField.YEAR).toFormatter();
        System.out.println(f.format(LocalDate.now()));
        System.out.println(f.format(YearMonth.now()));
        System.out.println(f.format(ZonedDateTime.now()));
    }

}
View Full Code Here

    private static void print2() {
        DateTimeFormatter f = new DateTimeFormatterBuilder().appendText(ChronoField.MONTH_OF_YEAR)
                .appendLiteral(' ').appendValue(ChronoField.YEAR).toFormatter();
        System.out.println(f.format(LocalDate.now()));
        System.out.println(f.format(YearMonth.now()));
        System.out.println(f.format(ZonedDateTime.now()));
    }

}
View Full Code Here

    private static void print2() {
        DateTimeFormatter f = new DateTimeFormatterBuilder().appendText(ChronoField.MONTH_OF_YEAR)
                .appendLiteral(' ').appendValue(ChronoField.YEAR).toFormatter();
        System.out.println(f.format(LocalDate.now()));
        System.out.println(f.format(YearMonth.now()));
        System.out.println(f.format(ZonedDateTime.now()));
    }

}
View Full Code Here

        StringBuilder buf = new StringBuilder();
        DateTimeFormatter format = DateTimeFormatter.ISO_DATE.withLocale(Locale.ENGLISH);
        long start = System.nanoTime();
        for (LocalDateTime dt : list) {
            buf.setLength(0);
            buf.append(format.format(dt));
        }
        long end = System.nanoTime();
        System.out.println("LocalDT:   Format: " + NF.format(end - start) + " ns" + " " + buf);
        result("LocalDT-P", end - start);
    }
View Full Code Here

        StringBuilder buf = new StringBuilder();
        DateTimeFormatter format = DateTimeFormatter.ISO_DATE.withLocale(Locale.ENGLISH);
        long start = System.nanoTime();
        for (LocalDate dt : list) {
            buf.setLength(0);
            buf.append(format.format(dt));
        }
        long end = System.nanoTime();
        System.out.println("LocalD:    Format: " + NF.format(end - start) + " ns" + " " + buf);
        result("LocalD-P", end - start);
    }
View Full Code Here

        StringBuilder buf = new StringBuilder();
        DateTimeFormatter format = DateTimeFormatter.ISO_TIME.withLocale(Locale.ENGLISH);
        long start = System.nanoTime();
        for (LocalTime dt : list) {
            buf.setLength(0);
            buf.append(format.format(dt));
        }
        long end = System.nanoTime();
        System.out.println("LocalT:    Format: " + NF.format(end - start) + " ns" + " " + buf);
        result("LocalT-P", end - start);
    }
View Full Code Here

        StringBuilder buf = new StringBuilder();
        DateTimeFormatter format = DateTimeFormatter.ISO_DATE.withLocale(Locale.ENGLISH);
        long start = System.nanoTime();
        for (ZonedDateTime dt : list) {
            buf.setLength(0);
            buf.append(format.format(dt));
        }
        long end = System.nanoTime();
        System.out.println("ZonedDT:   Format: " + NF.format(end - start) + " ns" + " " + buf);
        result("ZonedDT-P", end - start);
    }
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.