0

I use this library

com.github.samanzamani.persiandate:PersianDate:0.8

I want to make a list of the Persian month name and check for existing transaction in the month. Like the code below, I want to do this using the library above

private long getMonthTimestamp(long timestamp) {
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(new Date(timestamp));

    calendar.set(Calendar.DAY_OF_MONTH, 1);
    calendar.set(Calendar.HOUR_OF_DAY, 0);
    calendar.set(Calendar.MINUTE, 0);
    calendar.set(Calendar.SECOND, 0);
    calendar.set(Calendar.MILLISECOND, 0);

    return calendar.getTimeInMillis();
}

I am a beginner.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • Please go through the readme.md of the library. There is an [**example**](https://github.com/samanzamani/PersianDate#example) which will help you –  May 19 '20 at 11:21
  • Thanks. I studied. I tried several times. But I couldn't do it. You can do an example with this library similar to the code above – M khorsand May 19 '20 at 11:27
  • `PersianDate pd = new PersianDate(timestamp);` Next you can use the set methods which you want to set and finally use `PersianDateFormat pdformater2 = new PersianDateFormat('y F j'); pdformater2.format(pdate);` –  May 19 '20 at 11:32

0 Answers0