Get Month Name of java.time.chrono.HijrahDate instance

前端 未结 3 1373
野趣味
野趣味 2021-01-12 08:25
HijrahDate hd=HijrahChronology.INSTANCE.date(LocalDate.of(2014,11, 25));

If we have HijrahDate Instance , it is expected to have a met

3条回答
  •  鱼传尺愫
    2021-01-12 08:43

    The date does not contain information about the names of the months or days. To get that you need a formatter:

    System.out.println(DateTimeFormatter.ofPattern("MMMM").format(hd));
    

    prints Safar.

提交回复
热议问题