https://en.wikipedia.org/wiki/Ramadan


(calendar

month)[Ramadan]はイスラム暦の9月目です。

1. HijrahDate – > Ramadan 2016

ラマダン2016の始まりと終わりを計算する完全な例

TestHijrahDate.java

package com.mkyong.date;

import java.time.LocalDate;
import java.time.chrono.HijrahDate;
import java.time.temporal.ChronoField;
import java.time.temporal.TemporalAdjusters;

public class TestDate {

    public static void main(String[]args) {

       //first day of Ramadan, 9th month
        HijrahDate ramadan = HijrahDate.now()
                .with(ChronoField.DAY__OF__MONTH, 1).with(ChronoField.MONTH__OF__YEAR, 9);
        System.out.println("HijrahDate : " + ramadan);

       //HijrahDate -> LocalDate
        System.out.println("\n--- Ramandan 2016 ---");
        System.out.println("Start : " + LocalDate.from(ramadan));

       //until the end of the month
        System.out.println("End : " + LocalDate.from(ramadan.with(TemporalAdjusters.lastDayOfMonth())));

    }

}

出力

HijrahDate : Hijrah-umalqura AH 1437-09-01

--- Ramandan 2016 ---

開始:2016年6月6日
終了:2016-07-05

===参考文献