use of cn.hutool.core.date.Month in project hutool by looly.
the class DateTimeTest method datetimeTest.
@Test
public void datetimeTest() {
DateTime dateTime = new DateTime("2017-01-05 12:34:23", DatePattern.NORM_DATETIME_FORMAT);
// 年
int year = dateTime.year();
Assert.assertEquals(2017, year);
// 季度(非季节)
Season season = dateTime.seasonEnum();
Assert.assertEquals(Season.SPRING, season);
// 月份
Month month = dateTime.monthEnum();
Assert.assertEquals(Month.JANUARY, month);
// 日
int day = dateTime.dayOfMonth();
Assert.assertEquals(5, day);
}