Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

sword::CalendarJulian Class Reference

Julian Calendar implementation. More...

Inheritance diagram for sword::CalendarJulian:

sword::CalendarWestern sword::Calendar

Public Methods

virtual bool isValid (word day, word month, word year, word hour, word minute, word second, word millisecond) const
 Validates a 'dmy h:m:s' date value within this Calendar.

virtual bool isLeapYear (word year) const
 Checks whether a year is a leap year or not.

virtual int64 daysInMonth (word month, word year) const
 Computes the number of days in a month.

virtual int64 daysInYear (word year) const
 Computes the number of days in a year.

virtual int64 daysWithinYear (word day, word month, word year) const
 Computes the number of this day within its year (Jan 1st returns 0).

virtual int64 daysBeforeYear (word year) const
 Number of days from 1/1/1601 to 1/1/year.

virtual word weekDay (Time time) const
 Computes the day of the week (0=Sunday to 6=Saturday).

virtual Time easter (word year) const
 Computes the easter date for a given year.

virtual int64 dmy2days_ (word day, word month, word year) const
 Number of days to day/month/year.

virtual void days2dmy_ (int64 days, word &day, word &month, word &year) const
 Computes the day/month/year from the number of days.

virtual void convert (Time time, word &day, word &month, word &year, word &hour, word &minute, word &second, word &millisecond) const
 Converts a timestamp into a full 'dmy h:m:s' date value.

virtual void convert (Time time, word &day, word &month, word &year) const
 Converts a timestamp into a 'dmy' date value.

virtual Time convert (word day, word month, word year, word hour, word minute, word second, word millisecond) const
 Converts a full 'dmy h:m:s' date value into a timestamp.

virtual Time convert (word day, word month, word year) const
 Converts a 'dmy' date value into a timestamp (assuming hour is 0:0:0).


Detailed Description

Julian Calendar implementation.

The Julian calendar was created by Julius Caesar, and is very similar to our modern (Gregorian) calendar, expect for the definition of the leap years, which was over-simplistic. A year was a leap year only if it was divisble by 4.

In Year 1582, Julian was 10 days ahead of schedule (according to vernal equinox in northern countries to be on March 21st) and those days had to be dropped. Between 1582 and 1970, Julian calendard has accumulated 3 more days ahead (on years 1700, 1800, 1900), so in Julian calendar, our origin of times is in fact: "19 Dec 1969 0:0:0" ("1st of Jan 1970" - 13 days)

Warning:
internally, computation are performed on number of days since 1/1/0001, not since 1/1/1970 !
See also:
CalendarGregorian


Member Function Documentation

virtual Time sword::CalendarWestern::convert word    day,
word    month,
word    year
const [virtual, inherited]
 

Converts a 'dmy' date value into a timestamp (assuming hour is 0:0:0).

Implements sword::Calendar.

virtual Time sword::CalendarWestern::convert word    day,
word    month,
word    year,
word    hour,
word    minute,
word    second,
word    millisecond
const [virtual, inherited]
 

Converts a full 'dmy h:m:s' date value into a timestamp.

Implements sword::Calendar.

virtual void sword::CalendarWestern::convert Time    time,
word &    day,
word &    month,
word &    year
const [virtual, inherited]
 

Converts a timestamp into a 'dmy' date value.

Implements sword::Calendar.

virtual void sword::CalendarWestern::convert Time    time,
word &    day,
word &    month,
word &    year,
word &    hour,
word &    minute,
word &    second,
word &    millisecond
const [virtual, inherited]
 

Converts a timestamp into a full 'dmy h:m:s' date value.

Implements sword::Calendar.

virtual void sword::CalendarJulian::days2dmy_ int64    days,
word &    day,
word &    month,
word &    year
const [virtual]
 

Computes the day/month/year from the number of days.

Implements sword::Calendar.

virtual int64 sword::CalendarJulian::daysBeforeYear word    year const [virtual]
 

Number of days from 1/1/1601 to 1/1/year.

Implements sword::CalendarWestern.

virtual int64 sword::CalendarJulian::daysInMonth word    month,
word    year
const [virtual]
 

Computes the number of days in a month.

Implements sword::CalendarWestern.

virtual int64 sword::CalendarJulian::daysInYear word    year const [virtual]
 

Computes the number of days in a year.

Implements sword::CalendarWestern.

virtual int64 sword::CalendarJulian::daysWithinYear word    day,
word    month,
word    year
const [virtual]
 

Computes the number of this day within its year (Jan 1st returns 0).

Implements sword::CalendarWestern.

virtual int64 sword::CalendarJulian::dmy2days_ word    day,
word    month,
word    year
const [virtual]
 

Number of days to day/month/year.

Implements sword::Calendar.

virtual Time sword::CalendarJulian::easter word    year const [virtual]
 

Computes the easter date for a given year.

Implements sword::CalendarWestern.

virtual bool sword::CalendarJulian::isLeapYear word    year const [virtual]
 

Checks whether a year is a leap year or not.

Implements sword::CalendarWestern.

virtual bool sword::CalendarJulian::isValid word    day,
word    month,
word    year,
word    hour,
word    minute,
word    second,
word    millisecond
const [virtual]
 

Validates a 'dmy h:m:s' date value within this Calendar.

Implements sword::Calendar.

virtual word sword::CalendarJulian::weekDay Time    time const [virtual]
 

Computes the day of the week (0=Sunday to 6=Saturday).

Implements sword::CalendarWestern.


Generated on Tue Dec 23 20:08:56 2003 for SWORD by doxygen1.3-rc2