samanzamani / PersianDate

Persian date for android
BSD 3-Clause "New" or "Revised" License
326 stars 40 forks source link

parse error #40

Closed SudoDios closed 3 years ago

SudoDios commented 3 years ago

error when parsing

string date = "1399/09/07"; PersianDate persianDate = persianDateFormat.parse(date,"Y/m/d");

error message java.lang.ArrayIndexOutOfBoundsException: length=13; index=-1

samanzamani commented 3 years ago

Hi Look at PersianDateFormat in the documentation. For parse, you must use YYYY for the year, MM for the month, and dd for the day.

string date = "1399/09/07";
PersianDate persianDate = persianDateFormat.parse(date,"YYYY/MM/dd");
SudoDios commented 3 years ago

hello, thank you. 👍