ios - NSDateFormatter with NSIslamicCalendar doesn't work correctly -


After

I am changing the Greogorian date to the Hijri date using NSDateFormatter using a With the help of NSIslamicCalendar setter form set as the setter setCalendar the problem is that the result of the Hijri string is always more than the actual date for example one day if we out of today's Greg The code given below will be used to convert the date 18 '|| 1435 which is as wrong as today 17 Rabi '|| 1435 , I have seen many posts for these problems and I tried all possible solutions in those posts, but it does not make any sense !! Here is the heater for the hijriDateFormatter property: - (! _hijriDateFormatter)

  (NSDateFormatter *) hijriDateFormatter {{if_hijriDateFormatter = [[NSDateFormatter alloc] init]; } [_hijriDateFormatter setTimeZone: [NSTimeZone systemTimeZone]]; // I have trie also to set the time zone as localTimeZone _hijriDateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier: @ "en_US_POSIX"]; [_hijriDateFormatter setDateFormat: @ "MMMM dd, yyyy"]; [_hijriDateFormatter setCalendar: self.hijriCalendar]; Return_gradientfarmer;   

}

If (! _jjriCalendar) {_hijriCalendar = [[NSCalendar alloc] initWithCalendarIdentifier: NSIslamicCalendar]; } Return _giri calendar; }

Here I get HijriDate converted to a string:

  NSString * convertedHijriDate = [self.hijriDateFormatter stringFromDate: GregorianDate];   

Given that Gregorian debt is today's date and its value is: 2014-02-17 09:48:47 +0000 Please help me in these issues, thanks in advance

Islamic calendars are difficult apparently in acceptable use But there are different mathematical formulas which are born for different results. In addition, the correct calendar is based on the actual observations of the Moon, depending on your location, gives different results and for example weather (whether new moon is visible in one day, May be dependent on the weather; on a good day a new moon can hardly be difficult, while on a cloudy day it can not be seen). In short, there can be different numbers that all can be "right"

I suggest reading more about this subject, as you can and then find out That are the answers you show.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -