Following code will return the today's date in islamic calendar
NSCalendar *hijriCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSIslamicCivilCalendar];
NSDateComponents *hijriComponents = [hijriCalendar components:NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:[NSDate date]];
To get the current day of hijri calendar :
(long)[hijriComponents day]
To get the current month of hijri calendar :
(long)[hijriComponents month]
To get the current year of hijri calendar :
(long)[hijriComponents year]
Gregorian calendar =Islamic calendar
Jan = Muharram
Feb= safar
March=Rabi' I
April=Rabi' II
May=Jumada I
June=Jumada II
July=Rajab
August=Sha'ban
September =Ramadan
October =Shawwal
Nov=Dhu al-Qidah
Dec=Dhu al-Hijjah
so if
(long)[hijriComponents month]
return 1 means Muharram in hijri calendar
0 Comment(s)