Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 348025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:19:34+00:00 2026-05-12T11:19:34+00:00

I want to be able to convert between the Gregorian and Julian calendars (note:

  • 0

I want to be able to convert between the Gregorian and Julian calendars (note: not “julian date”) using NSCalendar on the iPhone. How can I subclass NSCalendar to use the Julian calendar? I want to do this without regards for 1582 or 1752 or any given year.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:19:34+00:00Added an answer on May 12, 2026 at 11:19 am

    While you can certainly have a go at it, but I suspect that NSCalendar is tricky to subclass. It’s toll-free bridged, which complicates things; is entwined with NSLocale, which complicates things; it’s initialized with identifiers rather than being subclassed, which complicates things; and gives no guidance on which methods are its primitives which… complicates things…

    Do you need the subclass in order to plug into an existing architecture? If not, it would probably be easiest to create an object from scratch that has a similar interface. You may be able to use an NSGregorianCalendar to do most of the work for you and just offset the date by the requisite days before calculating date components. You’ll need special logic for 1700, 1800 and 1900 (and of course 2100, etc.) since NSGregorianCalendar won’t let you create date components for a leap day in those years, but that’s still probably easier than doing all the date component calculations by hand.

    Just curious what the goal of such a calendar would be?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using GMP, and I want to be able to quickly convert an
I'm using LaTeX and BibTeX for an article, and I want to able to
I want to be able to replicate only the folder structure (not the contents)
I want to be able to convert a std::stack<> to a std::deque<>. Is there
I have a list of integers and I want to be able to convert
I want to be able to convert from one currency to another, I found
I want to be able to search on a DateTime field not only by
I'd like to be able to implicitly convert between two classes which are otherwise
I want to be able to convert a string number such as 1,427.76 to
I want to be able to implicitly convert Tuples of numbers (Ints and double)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.