Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get current date in time4j library?

Tags:

java

time4j

how I can get current Persian Date with time4Jin java?

PersianCalendar jalali = new PersianCalendar();
like image 759
MOHS3N Avatar asked Oct 16 '22 18:10

MOHS3N


1 Answers

From the Javadoc of PersianCalendar:

PlainDate today = SystemClock.inLocalView().today();
PersianCalendar jalali = today.transform(PersianCalendar.class);
like image 153
Erwin Bolwidt Avatar answered Nov 13 '22 05:11

Erwin Bolwidt