You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Dear
i'm using persianDate Library in my Project
i want to convert PersianDate String To epoch but the result is negative Value while the pattern of simpleDateFormat for Converting string to persianDate is same as same pattern of persianDate To String
below is my code:
Hi @Rezakeshavarz1376
If I understand your question correctly you want to convert a String date like 1401/04/17 to PersianDate and Date class and get the timestamps from the desired date. You can use this code:
Hi Dear
i'm using persianDate Library in my Project
i want to convert PersianDate String To epoch but the result is negative Value while the pattern of simpleDateFormat for Converting string to persianDate is same as same pattern of persianDate To String
below is my code:
I also used below codes to converting persianDate to epoch but result is also negative
persianDateFormat.parse(strDate).toDate().getTime();
persianDateFormat.parseGrg(strDate).getTime();
persianDateFormat.parse(strDate).getTime();
and i also pass pattern to parse method but result also is negative
note: I also use below pattern for simpledateformat but result is also negative :
'YYYY/MM/dd'
note 2: this is sample of pattern of my persianDateString :
1401/04/13
this is one of result in logcat :
getBirthDate: 1401/04/13 -> -17955663960000
How Can I use This library for converting PersianDate String to Java Date and also persianDate String to epoch
Thank's for you'r help
The text was updated successfully, but these errors were encountered: