constants
Calenders: Gregorian, Julian and Excel
You're viewing an older version of this page (#188). View the current version.
Interface
#include <codecogs/units/date/constants.h>
using namespace Units::Date;
Overview
| Mode | Description |
| cal_Julian | The Julian calendar was introduced in 45BC and was commonly used until the late 16 century. The Julian calendar is 365 1/4 days long, which gives an error of 1 day in every 128 years. |
| cal_Gregorian | The Gregorian calendar was first introduced in 1582 by predominantly Catholic countries, to rectify the error in the Julian calendar. This change occurred on the 4th October 1582, with 10 days being lost, such that 15th October was the next day. Over the next 500 years, the majority of the world has adopted this standard, the main exceptions being the Greek and Russian Orthodox churches, which still use the Julian calendar. |
| cal_Excel | The Excel date system isn't an official date system, but we use it here to provide compatibility to Microsoft Excel referring to a system that starts on 1 Jan 1900, such that years values below 1900, are assumed to be 1900+year. e.g. 20 is 1920; 110 is 2010. Excel on the Mac doesn't allow value prior to 1 January 1904, however for all practical purposes this limitation can be ignored. Aside from this peculiarity, both Excel date systems are identical to the Gregorian system. |
ENUM
dateDiffType
| Type | Description |
| dd_Europe | Start or end dates that occur on the 31st of a month become equal to the 30th of the same month. |
| dd_USA | This is identical to the \e European system with one exception that applies only to end dates: If the end date occurs on the 31st of a month it is moved to the 1st of the next month \b if the start date is earlier than the 30th. This method is sometime also called the 'NASD' method. |
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.
ENUM
weekNumStd
| Standard | Description |
| wkn_Simple | The simple week numbering scheme: - week 1 starts on the 1st January of any given year - week n+1 starts 7 days after week n |
| wkn_Excel | The Microsoft Excel numbering scheme: - week 1 starts on the 1st January of any given year - weeks also start on a Monday (resulting in short week 1's) |
| wkn_ISO | The ISO8601 standard that defines a week number as: - weeks start on a Monday. - week 1 of a given year is the one that includes the first Thursday of that year or (equivalently) the week that includes January 4th. |
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.
ENUM
weekdays
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.
ENUM
months
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.