CometDates

From CometWiki

(Difference between revisions)
Jump to: navigation, search
m (minor)
(added datetime)
 
(4 intermediate revisions not shown)
Line 1: Line 1:
<h2>Comet Dates</h2> -- Note this applies to comet 32 only.
<h2>Comet Dates</h2> -- 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.
+
CometDates are integers specifying the number of days before or after January 1, 1800. Positive numbers are after that date and negative numbers are before that date. To illustrate, the CometDate of -1 represents the date December 31,1799, and the CometDate of 1 represents January 2,1800.  
-
The practical range of CometDates are -657071 (01/01/0001) to 2994987 (12/31/9999). CometDates outside of that range will give strange results.
+
The practical range of CometDates are -657071 (01/01/0001) to 2994987 (12/31/9999). CometDates outside of that range may give strange results.
There are several ways to make a CometDate.
There are several ways to make a CometDate.
Line 8: Line 8:
*[[Date2Num|'''The Date2Num Function''']]
*[[Date2Num|'''The Date2Num Function''']]
*[[DateToNum|'''The DateToNum Function''']]
*[[DateToNum|'''The DateToNum Function''']]
-
*[[CometDate| Or preferably, the CometDate Function]]
+
*[[CometDate|'''Or preferably, the CometDate Function''']]
-
*'''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.
+
*'''Date Arithmetic''' -- Since CometDates are numbers, all arithmetic operators will work on them. Keep in mind that all of the conversion routines below will use just the integer portion of the CometDate presented. Make sure that any variable that can contain a CometDate has at least 7 digits as its integer part since CometDates can be that long.
-
*'''Conversion Functions'''
+
*'''CometDate Functions'''
-
**[[Date2Num]] -- Converts a date string to a CometDate.
+
**'''[[CometDate]]''' -- Converts month, day, year numbers into a CometDate.
-
**[[DateToNum]] -- Converts a date string to a CometDate.
+
**'''[[Year]]''' -- Returns the year from a CometDate.
-
**[[CometDate]] -- Converts month, day, year numbers into a CometDate.
+
**'''[[Month]]''' -- Returns the Month from a CometDate as a number where January = 1 etc
-
**[[Num2Date]] -- Represents a CometDate in various ways.
+
**'''[[Day]]''' -- Returns the Day of the Month from a CometDate  
-
**[[NumToDate]] -- Represents a CometDate in various ways.
+
**'''[[MonthName]]''' -- Returns the Month from a CometDate in the form "January", "February", etc.
-
**[[Year]] -- Returns the year from a CometDate.
+
**'''[[DayName]]''' -- Returns the Day of the week from a CometDate in the form "Monday", "Tuesday", etc.
-
**[[Month]] -- Returns the Month from a CometDate in the form January, February, etc.
+
**'''[[DayOfYear]]''' -- Returns the Day of the year as an integer.
-
**[[Day]] -- Returns the Day of the week from a CometDate in the form Monday, Tuesday, etc.
+
**'''[[DayOfWeek]]''' -- Returns the Day of the week as an integer from 1 to 7, where Sunday = 1, Monday = 2 etc.
-
**[[DayOfYear]] -- Returns the Day of the year as an integer.
+
**'''[[DayOfWorkWeek]]''' -- Returns the Day of the week as an integer from 1 to 7, where Monday = 1, Tuesday = 2 etc.
-
**[[DayOfWeek]] -- Returns the Day of the week as an integer from 1 to 7, where Sunday = 1, Monday = 2 etc.
+
**'''[[IsLeapYear]]''' -- Returns TRUE or FALSE depending on whether the CometDate falls within a Leap Year.
-
**[[DayOfWorkWeek]] -- Returns the Day of the week as an integer from 1 to 7, where Monday = 1, Tuesday = 2 etc.
+
**'''[[DateTime]]''' -- Returns a formatted string containing date/time elements. -- Very powerful.
-
**[[IsLeapYear]] -- Returns TRUE or FALSE depending on whether the CometDate falls within a Leap Year.
+
*'''Older Functions which also dealt with CometDates'''
 +
**'''[[Date2Num]]''' -- Converts a date string to a CometDate.
 +
**'''[[DateToNum]]''' -- Converts a date string to a CometDate.
 +
**'''[[Num2Date]]''' -- Represents a CometDate in various ways.
 +
**'''[[NumToDate]]''' -- Represents a CometDate in various ways.

Latest revision as of 22:43, 12 May 2011

Comet Dates

-- Note this applies to comet 32 only.

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

The practical range of CometDates are -657071 (01/01/0001) to 2994987 (12/31/9999). CometDates outside of that range may 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 of the conversion routines below will use just the integer portion of the CometDate presented. Make sure that any variable that can contain a CometDate has at least 7 digits as its integer part since CometDates can be that long.
  • CometDate Functions
    • CometDate -- Converts month, day, year numbers into a CometDate.
    • Year -- Returns the year from a CometDate.
    • Month -- Returns the Month from a CometDate as a number where January = 1 etc
    • Day -- Returns the Day of the Month from a CometDate
    • MonthName -- Returns the Month from a CometDate in the form "January", "February", etc.
    • DayName -- 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 1 to 7, where Sunday = 1, Monday = 2 etc.
    • DayOfWorkWeek -- Returns the Day of the week as an integer from 1 to 7, where Monday = 1, Tuesday = 2 etc.
    • IsLeapYear -- Returns TRUE or FALSE depending on whether the CometDate falls within a Leap Year.
    • DateTime -- Returns a formatted string containing date/time elements. -- Very powerful.
  • Older Functions which also dealt with CometDates
    • Date2Num -- Converts a date string to a CometDate.
    • DateToNum -- Converts a date string to a CometDate.
    • Num2Date -- Represents a CometDate in various ways.
    • NumToDate -- Represents a CometDate in various ways.
Personal tools