如何在 time4j 库中获取当前日期?
How to get current date in time4j library?
如何使用 time4J
在 java 中获取当前的波斯语日期?
PersianCalendar jalali = new PersianCalendar();
我认为有多种方法可以这样做:
-
PersianCalendar jalali = PersianCalendar.nowInSystemTime();
使用转换
PlainDate today = SystemClock.inLocalView().today();
PersianCalendar jalali = today.transform(PersianCalendar.class);
希望对您有所帮助!
PlainDate today = SystemClock.inLocalView().today();
PersianCalendar jalali = today.transform(PersianCalendar.class);
如何使用 time4J
在 java 中获取当前的波斯语日期?
PersianCalendar jalali = new PersianCalendar();
我认为有多种方法可以这样做:
-
PersianCalendar jalali = PersianCalendar.nowInSystemTime();
使用转换
PlainDate today = SystemClock.inLocalView().today(); PersianCalendar jalali = today.transform(PersianCalendar.class);
希望对您有所帮助!
PlainDate today = SystemClock.inLocalView().today();
PersianCalendar jalali = today.transform(PersianCalendar.class);