Jump to content
Sign in to follow this  
Followers 0
actionjdjackson

Hebrew NSCalendar seems to give wrong month order

1 post in this topic

Recommended Posts

Something is odd with Hebrew months when using NSCalendar - I type the following code:

let hebrewCalendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierHebrew)

let birthOfJesusDateComponents = NSDateComponents()

birthOfJesusDateComponents.year = 3755   //either 5 or 6 B.C. is possible year of His birth, I chose 6

birthOfJesusDateComponents.month = 7     //this is where the problem arises - 15 Tishri (7th month) is His most likely birthday, but as you'll see below it will print Adar

birthOfJesusDateComponents.day = 15

birthOfJesusDateComponents.hour = 21     //just a guess - sometime at night

birthOfJesusDateComponents.minute = 0

birthOfJesusDateComponents.second = 0

birthOfJesus = hebrewCalendar!.dateFromComponents(birthOfJesusDateComponents)!

Then, later, I type:

let hebrew = NSCalendar(calendarIdentifier: NSCalendarIdentifierHebrew)

let formatter = NSDateFormatter()

formatter.calendar = hebrew

formatter.dateStyle = .FullStyle

formatter.timeStyle = .MediumStyle


println(formatter.stringFromDate(birthOfJesus))

And I get as an output:

 

Friday, 15 Adar 3755 at 21:00:00

 

But here's the catch, Adar is NOT the 7th month of the Hebrew calendar, Tishri is. The Hebrew months have not changed since ancient times, so I know it should be Tishri, does anyone know what's going on here?

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By ITzTravelInTime
      Hi guys, this thread is to show you a new and open source app, created by me, that I called TINU:
       
      The name means: TINU Is Not #####, the U refers to a popular software that is used to create macOS hackintosh installers (that for good reasons is banned on this forum), but the aim of the name is to explain that this app is a totally different thing from that software and works in a totally different way.
       
      This app basically is a graphical interface for the createinstallmedia executable that is inside the macOS and Mac OS X installer apps, it is capable to create a bootable installer completely vanilla like what you do using the command line method, and also this method is recommended by apple itself. In addition to this, this app provvides to you simplicity and flexybility, and lets you to avoid most of the steps needed with every other app.
       
      TINU allows you to create easily a bootable macOS installer without messing around with command line stuff and without using disk utility, all you need to do is use the app and then install clover on the usb drive once TINU has finished or leave it as is if you want to use it on a real Mac.
       
      Features:
      - Simple-to-use UI that allows you to easily start the bootable macOS installer creation process.
      - It can work with every macOS installer app that has the createinstallmedia executable inside its resources folder (including also beta and newly released installers).
      - You can use any erasable volume that is at least 7 GB of size (if the volume's drive is not in GUID format, TINU will re-format it accordingly).
      - Can work with the Mac OS recovery system, so you can create a bootable macOS installer from the macOS installer itself or from the macOS recovery partition, and you can use TINU to install macOS, too.
      - 100% clean: The bootable macOS installers created with this tool are vanilla, just as if you created them using the command line "createinstallmedia" method in Terminal.
      - Open Source: You can verify what this program does on your computer and you can create your own version by downloading and playing with the source code.
      - Does not require any special preparations. Just open the program, make sure you have a USB drive plugged in and have a macOS installer app on your disk.
      - No need to use Disk Utility. TINU can format your drive or partition for you.
      - Integrated EFI partition mounter tool.
      - Uses recent, modern, APIs and SDKs and the Swift 3 language.
      - Transparent graphics style available (type alt-S or choose from the menu bar: View -> Use transparent style).
      - Works using the latest versions of macOS and will also support newer Mac installers out of the box without requiring an update.
      - Offers advanced features to customize your bootable macOS installer.
       
      Features that are planned for future versions:
      - Install and configure [Clover](https://sourceforge.net/projects/cloverefiboot/).
      - Install kexts into Clover's kexts folder.
      - Clover drivers customization
      - Use custom DSDT in Clover
      - Integrated pre-made Clover config templates database from a remote and open repository.
      - Support for other languages, at least Italian.
       
      # Requirements:
      - A computer that runs Mac OS X Yosemite or a more recent version (Mac OS X El Capitan is required to use TINU in a macOS recovery or installer).
      - A drive or a free partition (on a drive which already supports GUID) of least 7 GB that you want to turn into a macOS/Mac OS X installer.
      - A copy of a macOS/Mac OS X installer app (Maveriks or newer versions are supported) in the /Applications folder or in the root of any storage drive on your machine (excepted the drive or volume you want to turn into your macOS install media).
       
      Download:
      https://github.com/ITzTravelInTime/TINU/releases

      Frequently asked questions:
      https://github.com/ITzTravelInTime/TINU/wiki/FAQs
       
      Useful links:
      Thread (english) on insanelymac.com:
      - http://www.insanelymac.com/forum/topic/326959-tinu-the-macos-installer-creator-app-mac-app/
      Thread (italian) on insanelymac.com:
      - https://www.insanelymac.com/forum/topic/333261-tinu-app-per-creare-chiavette-di-installazione-di-macos-thread-in-italiano/
      Thread (english-german) on hackintosh-forum.de:
      - https://www.hackintosh-forum.de/index.php/Thread/33630-TINU/
      Post on Reddit:
      - https://www.reddit.com/r/hackintosh/comments/a1h61d/tinu_vanilla_bootable_macos_installer_creation/
      Facebook hackintosh help and beta testing (Italian only):
      - https://www.facebook.com/groups/Italia.hackintosh/?fref=ts
      Contact me (project creator):
      - Insanelymac.com profile: http://www.insanelymac.com/forum/user/1390153-itztravelintime/
      - email: piecaruso97@gmail.com
       
      Note that:
      - This software is under GNU GPL v3 license so any new branch/mod/third party release must be open source and under the same license
      - I (project creator) assume no responsibility for any use of this app and this source code, and also for any kind of hardware and software damage to any computer and any device or peripheral that may come from this app or source code during it's use and outside it's usage
      - I (project creator) do not guarantee support to you, this is only an open source project, not a product released by a company!
      - This project is born only for educational and demonstrative purposes, it's not intended to be used for commercial purposes and it will never be, don't use source code from this project to create apps or software for that aim.
      - This is a no-profit project, born only to let people to create macOS install medias in a more simple way and also to learn how to create this kind of apps.
       
      Credits:
      - Apple for macos and installer apps and scripts
      - People that helped me a lot:
      Francesco Perchiazzi, Nicola Tomarelli, Roberto Sciortino, Raffaele Sonnessa, Ermanno Nicoletti, Tommaso Dimatore, Michele Vitiello Bonaventura, Massimiliano Faralli, Davide Dessì, Giorgio Dall'Aglio, Peter Paul Chato.   
      - Special thanks to Italian Hackintosh group!! for help (https://www.facebook.com/groups/Italia.hackintosh/?fref=ts)
      - Thomas Tempelmann for help with the UI
      - Pietro Caruso (ITzTravelInTime) for creating, maintaing and developing this project
       
       
         
    • By StealthRT
      Hey all I am wanting to create a type of REST app that would allow me to send a command to the iPad mini and have it either turn off and/or disable the home button. 

      I understand that these features would be available with 3rd party/ non-documented apis that would never pass Apples requirements. However, I am only using this app for personal use at home. 

      So has anyone done the above? Is it possible to do using iOS 11 on the iPad mini with Swift/Objective C?

      Thanks!
    • By Technologx
      I was wondering how do I go about making a WKWebView Mac app for https://apps.facebook.com/thetribez? I also want to link the About The Tribez and Contact menu items to a html file.
       
      I'm new to coding and want to try and learn.
    • By Hundley
      Hey guys, I'd love to hear your feedback on a project I've been working on!
       
      Swift AI is a high-performance artificial intelligence and machine learning library, written entirely in Swift.  It makes it easy to integrate AI into your own iOS apps - whether it be OCR, facial recognition, function regression or video game AI.  Check it out!
       
      See the source code and full documentation on Github:  https://github.com/collinhundley/Swift-AI
×