Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There were 445 days in 45 BC, so you'll need to add that in, and the switch from <a href="http://msdn.microsoft.com/en-us/library/system.globalization.juliancalendar.aspx" rel="nofollow noreferrer">Julian</a> (45bc) to the previous roman calendar. The Gregorian calendar change came a lot later (1500s) than you need so you don't have to worry about that.</p> <p>The two main problems of using DateTime are the min and max constants. Obviously being a struct you can't subclass it either.</p> <p>My first option would be to write my BigDateTime or BCDateTime struct, and use a DateTime inside that via composition. You can then set your current Calendar:</p> <pre><code>CultureInfo.CurrentCulture.DateTimeFormat.Calendar = new JulianCalendar(); </code></pre> <p>for to the <a href="http://msdn.microsoft.com/en-us/library/system.globalization.juliancalendar.aspx" rel="nofollow noreferrer">Julian</a> one but as I mentioned that only gives you to 45 years BC</p> <p>If the year is below 45 you switch Calendars again to your own subclassed <a href="http://msdn.microsoft.com/en-us/library/system.globalization.calendar.aspx" rel="nofollow noreferrer">Calendar</a> object. If the year is 45, you'll need another Calendar with the 445 days for that year (they did this to adjust between the older Calendar).</p> <p>What will your min and max constants be for this object? The dawning of civilisation itself?! </p> <p>You will need to pick those, and also bare in mind the Julian calendar and its previous non-reformed version were specific for the countries of the Roman empire. Being a westerner I have no idea of the other calendars that existed, you'll get a lot more information from <a href="http://en.wikipedia.org/wiki/Calendar" rel="nofollow noreferrer">the</a> <a href="http://en.wikipedia.org/wiki/Julian_calendar" rel="nofollow noreferrer">wikipedia</a> <a href="http://en.wikipedia.org/wiki/Calendar_reform" rel="nofollow noreferrer">articles</a> <a href="http://en.wikipedia.org/wiki/Lunisolar_calendar" rel="nofollow noreferrer">though</a>.</p> <p>If you choose to do all cultures then you have a mammoth task on your hands (as the original .NET team did) to implement calendars that already exist. Different calendars have different starting epochs relative to BC, such as the Islamic, Chinese and Hindu calendars. More information on that is <a href="http://en.wikipedia.org/wiki/Calendar_era" rel="nofollow noreferrer">here</a>. So if you want every culture and not just the Roman empire you will need to make your own version of the following, or atleast some of them:</p> <pre><code>System.Globalization.Calendar System.Globalization.EastAsianLunisolarCalendar System.Globalization.GregorianCalendar System.Globalization.HebrewCalendar System.Globalization.HijriCalendar System.Globalization.JapaneseCalendar System.Globalization.JulianCalendar System.Globalization.KoreanCalendar System.Globalization.PersianCalendar System.Globalization.TaiwanCalendar System.Globalization.ThaiBuddhistCalendar System.Globalization.UmAlQuraCalendar </code></pre> <p>Good luck! It'd be interesting to see how you get on.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload