Example usage for java.time Month DECEMBER

List of usage examples for java.time Month DECEMBER

Introduction

In this page you can find the example usage for java.time Month DECEMBER.

Prototype

Month DECEMBER

To view the source code for java.time Month DECEMBER.

Click Source Link

Document

The singleton instance for the month of December with 31 days.

Usage

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.DECEMBER;
    System.out.println(m.getValue());
    System.out.println(m.name());
    System.out.println(m.ordinal());
}

From source file:Main.java

public static void main(String[] args) {
    LocalDateTime currentDateTime = LocalDateTime.now();
    System.out.println(currentDateTime); // 2014-06-27T09:04:47.527

    // 2014-10-02 12:30
    LocalDateTime secondAug2014 = LocalDateTime.of(2014, 10, 2, 12, 30);
    System.out.println(secondAug2014); // 2014-10-02T12:30

    // 2014-12-24 12:00
    LocalDateTime christmas2014 = LocalDateTime.of(2014, Month.DECEMBER, 24, 12, 0);
    System.out.println(christmas2014); // 2014-12-24T12:00
}

From source file:Main.java

public static void main(String[] args) {

    // the current date
    LocalDate currentDate = LocalDate.now();

    // 2014-02-10
    LocalDate tenthFeb2014 = LocalDate.of(2014, Month.FEBRUARY, 10);

    // months values start at 1 (2014-08-01)
    LocalDate firstAug2014 = LocalDate.of(2014, 8, 1);

    // the 65th day of 2010 (2010-03-06)
    LocalDate sixtyFifthDayOf2010 = LocalDate.ofYearDay(2010, 65);

    // times, e.g. 19:12:30.733

    LocalTime currentTime = LocalTime.now(); // current time
    LocalTime midday = LocalTime.of(12, 0); // 12:00
    LocalTime afterMidday = LocalTime.of(13, 30, 15); // 13:30:15

    // 12345th second of day (03:25:45)
    LocalTime fromSecondsOfDay = LocalTime.ofSecondOfDay(12345);

    // dates with times, e.g. 2014-02-18T19:08:37.950
    LocalDateTime currentDateTime = LocalDateTime.now();

    // 2014-10-02 12:30
    LocalDateTime secondAug2014 = LocalDateTime.of(2014, 10, 2, 12, 30);

    // 2014-12-24 12:00
    LocalDateTime christmas2014 = LocalDateTime.of(2014, Month.DECEMBER, 24, 12, 0);

    // current (local) time in Los Angeles
    LocalTime currentTimeInLosAngeles = LocalTime.now(ZoneId.of("America/Los_Angeles"));

    // current time in UTC time zone
    LocalTime nowInUtc = LocalTime.now(Clock.systemUTC());

    System.out.println("date/time creation: currentDate: " + currentDate);
    System.out.println("date/time creation: tenthFeb2014: " + tenthFeb2014);
    System.out.println("date/time creation: firstAug2014: " + firstAug2014);
    System.out.println("date/time creation: sixtyFifthDayOf2010: " + sixtyFifthDayOf2010);
    System.out.println("date/time creation: currentTime: " + currentTime);
    System.out.println("date/time creation: midday: " + midday);
    System.out.println("date/time creation: afterMidday: " + afterMidday);
    System.out.println("date/time creation: fromSecondsOfDay: " + fromSecondsOfDay);
    System.out.println("date/time creation: currentTimeInLosAngeles: " + currentTimeInLosAngeles);
    System.out.println("date/time creation: currentDateTime: " + currentDateTime);
    System.out.println("date/time creation: secondAug2014: " + secondAug2014);
    System.out.println("date/time creation: christmas2014: " + christmas2014);
}

From source file:Main.java

public static List<Employee> persons() {
    Employee p1 = new Employee(1, "Jake", Gender.MALE, LocalDate.of(1971, Month.JANUARY, 1), 2343);
    Employee p2 = new Employee(2, "Jack", Gender.MALE, LocalDate.of(1972, Month.JULY, 21), 7100);
    Employee p3 = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1973, Month.MAY, 29), 5455);
    Employee p4 = new Employee(4, "Jode", Gender.MALE, LocalDate.of(1974, Month.OCTOBER, 16), 1800);
    Employee p5 = new Employee(5, "Jeny", Gender.FEMALE, LocalDate.of(1975, Month.DECEMBER, 13), 1234);
    Employee p6 = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1976, Month.JUNE, 9), 3211);

    List<Employee> persons = Arrays.asList(p1, p2, p3, p4, p5, p6);

    return persons;
}

From source file:Main.java

public static List<Employee> persons() {
    Employee p1 = new Employee(1, "Jake", Gender.MALE, LocalDate.of(1971, Month.JANUARY, 1), 2343.0);
    Employee p2 = new Employee(2, "Jack", Gender.MALE, LocalDate.of(1972, Month.JULY, 21), 7100.0);
    Employee p3 = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1973, Month.MAY, 29), 5455.0);
    Employee p4 = new Employee(4, "Jode", Gender.MALE, LocalDate.of(1974, Month.OCTOBER, 16), 1800.0);
    Employee p5 = new Employee(5, "Jeny", Gender.FEMALE, LocalDate.of(1975, Month.DECEMBER, 13), 1234.0);
    Employee p6 = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1976, Month.JUNE, 9), 3211.0);
    List<Employee> persons = Arrays.asList(p1, p2, p3, p4, p5, p6);
    return persons;
}

From source file:org.springsource.restbucks.payment.CreditCardRepositoryIntegrationTest.java

public static CreditCard createCreditCard() {

    CreditCardNumber number = new CreditCardNumber("4321432143214321");
    return new CreditCard(number, "Oliver Gierke", Month.DECEMBER, Year.of(2020));
}

From source file:Main.java

public static List<Employee> persons() {
    Employee p1 = new Employee(1, "Jake", Gender.MALE, LocalDate.of(1971, Month.JANUARY, 1), 2343.0);
    Employee p2 = new Employee(2, "Jack", Gender.MALE, LocalDate.of(1972, Month.JULY, 21), 7100.0);
    Employee p3 = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1973, Month.MAY, 29), 5455.0);
    Employee p4 = new Employee(4, "Jode", Gender.MALE, LocalDate.of(1974, Month.OCTOBER, 16), 1800.0);
    Employee p5 = new Employee(5, "Jeny", Gender.FEMALE, LocalDate.of(1975, Month.DECEMBER, 13), 1234.0);
    Employee p6 = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1976, Month.JUNE, 9), 3211.0);

    List<Employee> persons = Arrays.asList(p1, p2, p3, p4, p5, p6);

    return persons;
}

From source file:Main.java

public static List<Employee> persons() {
    Employee ken = new Employee(1, "Jame", Gender.MALE, LocalDate.of(1970, Month.MAY, 4), 6123.0);
    Employee jeff = new Employee(2, "Jeff", Gender.MALE, LocalDate.of(1971, Month.JULY, 5), 7112.0);
    Employee donna = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1972, Month.JULY, 9), 8712.0);
    Employee chris = new Employee(4, "Jodd", Gender.MALE, LocalDate.of(1973, Month.DECEMBER, 6), 1823.0);
    Employee laynie = new Employee(5, "Janey", Gender.FEMALE, LocalDate.of(1974, Month.DECEMBER, 3), 1234.0);
    Employee lee = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1975, Month.MAY, 8), 2412.0);

    // Create a list of persons
    List<Employee> persons = Arrays.asList(ken, jeff, donna, chris, laynie, lee);

    return persons;
}

From source file:org.springsource.restbucks.payment.PaymentInitializer.java

@Autowired
public PaymentInitializer(CreditCardRepository repository) {

    if (repository.count() > 0) {
        return;/*from   w w  w  .j  av  a  2 s  . c  om*/
    }

    CreditCardNumber number = new CreditCardNumber("1234123412341234");
    CreditCard creditCard = new CreditCard(number, "Oliver Gierke", Month.DECEMBER, Year.of(2099));

    creditCard = repository.save(creditCard);

    LOG.info("Credit card {} created!", creditCard);
}

From source file:com.javiermoreno.springboot.mvc.users.UserManagementServiceImplIT.java

@Test
public void checkNewUserIsSavedAndContainsCorrectPasswordHash() {
    DailyUser user = new DailyUser();
    user.setEmail("alice@wonderland.com");
    user.setBirthday(/*from   ww  w .  j a  v a  2 s.c o  m*/
            Date.from(LocalDate.of(1976, Month.DECEMBER, 12).atStartOfDay(ZoneId.systemDefault()).toInstant()));
    service.registerNewUser(user, "secret", true);

    Assert.assertNotSame("Id correctly assigned", 0, user.getId());
    Assert.assertEquals("Password md5 is correctely encoded.", "5ebe2294ecd0e0f08eab7690d2a6ee69",
            user.getPassword());
}