CometDates

From CometWiki

Revision as of 18:14, 7 December 2010 by Jim (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Comet Dates

-- Note this applies to comet 32 only.

CometDates are integers specifying the number of days before or after January 1, 1800. Positive dates are after that date and negative numbers are before that date. To illustrate, the CometDate 0f -1 represents the date December 31,1799, and the CometDate of 1 represents January 2,1800.

The practical range of CometDates are -657073 (01/01/0001) to 2994987 (12/31/9999). CometDates outside of that range will give strange results.

There are several ways to make a CometDate.

  • Date Arithmetic -- Since CometDates are numbers, all arithmetic operators will work on them. Keep in mind that all conversion routines will use just the integer portion of the CometDate presented.
  • Conversion Functions
    • Date2Num -- Converts a date string to a CometDate.
    • DateToNum' -- Converts a date string to a CometDate.
    • CometDate -- Converts month, day, year numbers into a CometDate.
    • Num2Date -- Represents a CometDate in various ways.
    • NumToDate -- Represents a CometDate in various ways.
    • Year -- Returns the year from a CometDate.
    • Month -- Returns the Month from a CometDate in the form January, February, etc.
    • Day -- Returns the Day of the week from a CometDate in the form Monday, Tuesday, etc.
    • DayOfYear -- Returns the Day of the year as an integer.
    • DayOfWeek -- Returns the Day of the week as an integer from 0 to 6, where Sunday = 0, Monday = 1 etc.
    • DayOfWorkWeek -- Returns the Day of the week as a number, where Monday = 0, Tuesday = 1 etc.
    • IsLeapYear -- Returns TRUE or FALSE depending on whether the CometDate falls within a Leap Year.
Personal tools