我如何在java中使用time4J
获取当前的波斯日期?
PersianCalendar jalali = new PersianCalendar();
From the Javadoc of PersianCalendar
:
PlainDate today = SystemClock.inLocalView().today();
PersianCalendar jalali = today.transform(PersianCalendar.class);
I think there are multiple ways to do so:
PersianCalendar jalali = PersianCalendar.nowInSystemTime();
using transformation
PlainDate today = SystemClock.inLocalView().today(); PersianCalendar jalali = today.transform(PersianCalendar.class);
Hope it helps!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.