枚举类的使用
java.time.Month
使用 Month 的包
-
Month 在 java.time 中的用法
修饰符和类型方法描述Month.firstMonthOfQuarter()获取本季度第一个月对应的月份。static MonthMonth.from(TemporalAccessor temporal) 从时间对象中获取Month的实例。LocalDate.getMonth()使用Month枚举获取月份字段。LocalDateTime.getMonth()使用Month枚举获取月份字段。MonthDay.getMonth()使用Month枚举获取月份字段。OffsetDateTime.getMonth()使用Month枚举获取月份字段。YearMonth.getMonth()使用Month枚举获取月份字段。ZonedDateTime.getMonth()使用Month枚举获取月份字段。Month.minus(long months) 返回在此之前的指定月数的一年中的月份。static MonthMonth.of(int month) 从int值获取Month的实例。Month.plus(long months) 返回一年中的月份,即在此月份之后的指定月份数。static Month返回具有指定名称的此类的枚举常量。static Month[]Month.values()返回一个数组,其中包含此枚举类的常量,按照它们声明的顺序排列。修饰符和类型方法描述将今年与一个月结合起来创建一个YearMonth。static LocalDate从年、月和日中获取LocalDate的实例。static LocalDateTime从年、月、日、小时和分钟中获取LocalDateTime的实例,将秒和纳秒设置为零。static LocalDateTime从年、月、日、小时、分钟和秒中获取LocalDateTime的实例,将纳秒设置为零。static LocalDateTimeLocalDateTime.of(int year, Month month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) 从年、月、日、小时、分钟、秒和纳秒中获取LocalDateTime的实例。static MonthDay获得MonthDay的实例。static YearMonth从年份和月份中获取YearMonth的实例。返回此MonthDay的副本,其中月份已更改。 -
Month 在 java.time.zone 中的用法
java.time.zone 中返回 Month 的方法java.time.zone 中的方法,参数类型为 Month修饰符和类型方法描述static ZoneOffsetTransitionRuleZoneOffsetTransitionRule.of(Month month, int dayOfMonthIndicator, DayOfWeek dayOfWeek, LocalTime time, boolean timeEndOfDay, ZoneOffsetTransitionRule.TimeDefinition timeDefinition, ZoneOffset standardOffset, ZoneOffset offsetBefore, ZoneOffset offsetAfter) 获得一个定义年度规则的实例,以在两个偏移量之间创建转换。