Package java.time

Examples of java.time.Month


        LocalDateTime sylvester = LocalDateTime.of(2014, Month.DECEMBER, 31, 23, 59, 59);

        DayOfWeek dayOfWeek = sylvester.getDayOfWeek();
        System.out.println(dayOfWeek);      // WEDNESDAY

        Month month = sylvester.getMonth();
        System.out.println(month);          // DECEMBER

        long minuteOfDay = sylvester.getLong(ChronoField.MINUTE_OF_DAY);
        System.out.println(minuteOfDay);    // 1439
View Full Code Here


  /**
   * Date/time classes provide getter methods for obtaining their component values (different component resolutions).
   */
  @Test
  public void testGetDateTimeComponentValues() {
    final Month month = Month.AUGUST;
    int dayOfMonth = 31;
    int seconds = 59;

    final LocalDateTime localDateTime = LocalDateTime.of(2014, month, dayOfMonth, 18, 46, seconds);

View Full Code Here

TOP

Related Classes of java.time.Month

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.