1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| import net.time4j.PlainDate; import net.time4j.calendar.ChineseCalendar; import net.time4j.calendar.EastAsianMonth; import net.time4j.calendar.EastAsianYear;
import java.time.LocalDate;
public class Test { public static void main(String[] args) { ChineseCalendar calendar = ChineseCalendar.of(EastAsianYear.forGregorian(2023), EastAsianMonth.valueOf(1), 1); LocalDate chineseNewYear = calendar.transform(PlainDate.axis()).toTemporalAccessor(); System.out.println(chineseNewYear); } }
|