iOS Question Convert Gregorian date to Islamic date

Discussion in 'iOS Questions' started by Pooya1, Dec 5, 2018.

  1. Pooya1

    Pooya1 Active Member Licensed User

    I want to convert Gregorian date to Islamic date
    I found below code in stackoverflow if it is right code
    That is simple code but i dont know how do use it in B4i

    let dateFormatter = NSDateFormatter()
    dateFormatter.dateFormat = 
    let GregorianDate = dateFormatter.dateFromString(
    let islamic = NSCalendar(identifier: NSCalendarIdentifierIslamicUmmAlQura)
    let components = islamic?.components(NSCalendarUnit(rawValue: UInt.max), fromDate: GregorianDate!)
    resultlable.text = 
    "\(components!.year) - \(components!.month) - \(components!.day)"
    Last edited: Dec 5, 2018
  2. Ohanian

    Ohanian Active Member Licensed User

  3. Pooya1

    Pooya1 Active Member Licensed User

    I need Hijri date from 1400 year
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice