Vision Messages: Date

| Home | Date Class | Message XRef | Messages (General) |

Profile of Class Date


Includes Classes: Date, Ordinal



Object
  | 
Ordinal
  | 
  +--- Date


The instances of the class Date represent a specific day in the
calendar.  Each date encompasses a day, month, and year.  Dates are
formed in one of two ways.  Explicit dates can be derived by sending
the asDate message to integers in one of the forms illustrated below:

     Integer Form            Example             Returns Date
     -----------------------------------------------------------------
     YYYYMMDD                19850923 asDate      9/23/1985
       YYMMDD                  861015 asDate     10/15/1986
         YYMM                    8803 asDate      3/31/1988
           YY                      87 asDate     12/31/1987

Dates can also be formed relative to another date by adding or
subtracting a date offset to or from the date.  For example:  

     88 asDate - 5 days          ==>   12/26/1988
     87 asDate + 1 monthEnds     ==>    1/31/1988


Message Index

o != aDate
o + aDateOffset
o - aDateOffset
o < aNumber (Ordinal)
o < aDate (Date)
o <= aNumber (Ordinal)
o <= aDate (Date)
o = aDate
o > aNumber (Ordinal)
o > aDate (Date)
o >= aNumber (Ordinal)
o >= aDate (Date)
o DayOfWeekDescriptor
o MonthDescriptor
o __fixReference
o asBDay
o asBDayMonday
o asCurrentYearMMDD
o asDate
o asIDate7
o asInteger
o asMonthEnd
o asMostRecentBusinessMonthEnd
o asMostRecentMonthEnd
o asQuarterEnd
o asSelf (Ordinal)
o asSelf (Date)
o asYearBeginning
o asYearEnd
o between: anOrdinal1 and: anOrdinal2
o by: aDateOffset from: aDate evaluate: aBlock
o by: aDateOffset to: aDate evaluate: aBlock
o classDescriptor (Ordinal)
o classDescriptor (Date)
o convertFrom: string
o count30DayDaysTo: aDate
o count360DayYearsTo: aDate
o count6monthIntervalsTo: aDate
o countBDaysTo: aDate
o countDaysTo: aDate
o countFullMonthsTo: aDate
o countIntervalsOf: aDateOffset to: aDate
o countMonthsTo: aDate
o countYearsTo: aDate
o day
o dayNumberOfWeek
o dayOfWeek
o defaultInstance (Ordinal)
o defaultInstance (Date)
o evaluate: aBlock
o extract: block for: object
o formatUsingLongName
o formatUsingMMDD
o formatUsingMMDDYY
o formatUsingMMDDYYYY
o formatUsingShortName
o getDayOfWeekDescriptor
o getMonthDescriptor
o Ordinal inRange: aList
o inSet: aList
o inputExpression
o isDate
o isDefault
o isInitialDate
o isLastBusinessDayOfMonth
o isMonthEnd
o isOrdinal
o isValid
o isntValid
o max: aNumber
o min: aNumber
o month
o new
o notBetween: anOrdinal1 and: anOrdinal2
o print
o print: anInteger
o quarterNumber
o to: aDate by: aDateOffset
o whatAmI (Ordinal)
o whatAmI (Date)
o year


Messages

o !=

Synopsis:
Date != aDate

Description:

Tests if recipient date is the same as the supplied date.

Type: Method          Returns: Boolean

Parameters:

1 - Date

Also Defined At:
| Number | Object | String |

o +

Synopsis:
Date + aDateOffset

Description:

Adds the supplied date increment to the recipient date.

Type: Method          Returns: Date

Parameters:

1 - DateOffset

Also Defined At:
| DateOffset | List | TimeSeries | Undefined |

o -

Synopsis:
Date - aDateOffset

Description:

Subtracts the supplied date increment from the recipient date

Type: Method          Returns: Date

Parameters:

1 - DateOffset

Also Defined At:
| List | TimeSeries | Undefined |

o <

Synopsis:
Ordinal < aNumber

Description:

Tests if recipient is smaller than supplied value. Each subclass of Ordinal must redefine this message. If a subclass does not implement <, then an attempt to send the message to a subclass results in an error message of the form: >>> '<' must be implemented for 'recipient' <<<.

Type: Method          Returns: Boolean

Parameters:

1 - Number

Also Defined At:
| Date | Object | String | Undefined |

o <

Synopsis:
Date < aDate

Description:

Tests if recipient date comes before supplied date.

Type: Method          Returns: Boolean

Parameters:

1 - Date

Also Defined At:
| Object | String | Undefined |

o <=

Synopsis:
Ordinal <= aNumber

Description:

Tests if recipient is smaller than or equal to supplied value.

Type: Method          Returns: Boolean

Parameters:

1 - Number

Also Defined At:
| Date | Object | String | Undefined |

o <=

Synopsis:
Date <= aDate

Description:

Tests if recipient date is the same or earlier than supplied date.

Type: Method          Returns: Boolean

Parameters:

1 - Date

Also Defined At:
| Object | String | Undefined |

o =

Synopsis:
Date = aDate

Description:

Tests if recipient date is the same as the supplied date.

Type: Method          Returns: Boolean

Parameters:

1 - Date

Also Defined At:
| Object | String |

o >

Synopsis:
Ordinal > aNumber

Description:

Tests if recipient is larger than supplied value.

Type: Method          Returns: Boolean

Parameters:

1 - Number

Also Defined At:
| Date | Number | Object | String | Undefined |

o >

Synopsis:
Date > aDate

Description:

Tests if recipient date is later than supplied date.

Type: Method          Returns: Boolean

Parameters:

1 - Date

Also Defined At:
| Number | Object | String | Undefined |

o >=

Synopsis:
Ordinal >= aNumber

Description:

Tests if recipient is larger than or equal to supplied value.

Type: Method          Returns: Boolean

Parameters:

1 - Number

Also Defined At:
| Date | Number | Object | String | Undefined |

o >=

Synopsis:
Date >= aDate

Description:

Tests if recipient date is the same or earlier than supplied date.

Type: Method          Returns: Boolean

Parameters:

1 - Date

Also Defined At:
| Number | Object | String | Undefined |

o DayOfWeekDescriptor

Synopsis:
Date DayOfWeekDescriptor

Description:

Returns default 'Date DayOfWeekDescriptor' object

Type: Constant          Returns: Date DayOfWeekDescriptor

o MonthDescriptor

Synopsis:
Date MonthDescriptor

Description:

Returns default 'Date MonthDescriptor' object

Type: Constant          Returns: Date MonthDescriptor

o __fixReference

Synopsis:
Date __fixReference

Type: Method          Returns: Object

Also Defined At:
| DateOffset | Object |

o asBDay

Synopsis:
Date asBDay

Description:

Converts the recipient date to a business day (Monday - Friday). If the recipient date is a Monday through Friday date, that date is returned. If the recipient date is a Saturday or Sunday date, the previous Friday's date is returned.

Type: Method          Returns: Date

o asBDayMonday

Synopsis:
Date asBDayMonday

Description:

Converts the recipient date to a business day (Monday - Friday). If the recipient date is a Monday through Friday date, that date is returned. If the recipient date is a Saturday or Sunday date, the following Monday's date is returned.

Type: Method          Returns: Date

o asCurrentYearMMDD

Synopsis:
Date asCurrentYearMMDD

Description:

Converts recipient date to same date in current year.

Type: Method          Returns: Date

o asDate

Synopsis:
Date asDate

Description:

Returns recipient stripped of any extensions.

Type: Primitive          Returns: Date

Also Defined At:
| DateOffset | Number | String | Undefined |

o asIDate7

Synopsis:
Date asIDate7

Description:

Converts recipient into an integer representing the number of days since January 1, 0001. Useful for computing the number of days between two dates.

Type: Primitive          Returns: Integer

o asInteger

Synopsis:
Date asInteger

Description:

Converts a date into an integer in YYYYMMDD form.

Type: Primitive          Returns: Integer

Also Defined At:
| DateOffset | String | Undefined |

o asMonthEnd

Synopsis:
Date asMonthEnd

Description:

Returns the month-end date for the Date represented by the recipient.

Type: Method          Returns: Date

o asMostRecentBusinessMonthEnd

Synopsis:
Date asMostRecentBusinessMonthEnd

Description:

Returns the last business day in the month on or before the recipient date.

Type: Method          Returns: Date

o asMostRecentMonthEnd

Synopsis:
Date asMostRecentMonthEnd

Description:

Returns the last month-end date relative to the recipient date. If recipient is not a month-end date, the previous month-end date is returned. If recipient is a month-end date, it is returned.

Type: Method          Returns: Date

o asQuarterEnd

Synopsis:
Date asQuarterEnd

Description:

Returns the quarter-end date for the Date represented by the recipient.

Type: Method          Returns: Date

o asSelf

Synopsis:
Ordinal asSelf

Description:

Returns the original object.

Type: Primitive          Returns: Ordinal

Also Defined At:
| Block | Boolean | Classification | Collection | Currency | Date | DateOffset | DateRange | Dictionary | Entity | IndexedList | Interface | List | Number | Object | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o asSelf

Synopsis:
Date asSelf

Description:

Returns the original object.

Type: Primitive          Returns: Date

Also Defined At:
| Block | Boolean | Classification | Collection | Currency | DateOffset | Dictionary | Entity | IndexedList | Interface | List | Number | Object | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o asYearBeginning

Synopsis:
Date asYearBeginning

Description:

Returns the year-beginning date for the Date represented by the recipient.

Type: Method          Returns: Date

o asYearEnd

Synopsis:
Date asYearEnd

Description:

Returns the year-end date for the Date represented by the recipient.

Type: Method          Returns: Date

o between:and:

Synopsis:
Ordinal between: anOrdinal1 and: anOrdinal2

Description:

Tests if recipient Ordinal is between supplied Ordinal1 and supplied Ordinal2

Type: Method          Returns: Boolean

Parameters:

1 - String
2 - String

Also Defined At:
| Undefined |

o by:from:evaluate:

Synopsis:
Date by: aDateOffset from: aDate evaluate: aBlock

Description:

Evaluates supplied Block for recipient Date by supplied increment from supplied Date

Type: Method          Returns: Object

Parameters:

1 - DateOffset
2 - Date
3 - Block

o by:to:evaluate:

Synopsis:
Date by: aDateOffset to: aDate evaluate: aBlock

Description:

Evaluates supplied Block for recipient Date by supplied increment to supplied Date.

Type: Method          Returns: Object

Parameters:

1 - DateOffset
2 - Date
3 - Block

o classDescriptor

Synopsis:
Ordinal classDescriptor

Description:

Reference to the object which describes the class. Class level information is stored here.

Type: Constant          Returns: Object

Also Defined At:
| Block | Boolean | Classification | Collection | Currency | Date | DateOffset | DateRange | Dictionary | Entity | IndexedList | Interface | List | Number | Object | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o classDescriptor

Synopsis:
Date classDescriptor

Description:

Reference to the object which describes the class. Class level information is stored here.

Type: Constant          Returns: Object

Also Defined At:
| Block | Boolean | Classification | Collection | Currency | DateOffset | Dictionary | Entity | IndexedList | Interface | List | Number | Object | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o convertFrom:

Synopsis:
Date convertFrom: string

Description:

This message converts the supplied string to an instance of the recipient's class if applicable, returning NA otherwise. The definition at Object will lookup the string in the class' naming dictionary, if defined. The version at String returns the recipient stripped of any extensions. The versions at Number, Integer, Double, and Float convert the recipient to a numeric value if possible. The version at Date converts the recipient to a Date using the 'asDate' message defined at String. The version at Boolean returns TRUE if the recipient contains an upper/lower case combination of 'true' and FALSE if the recipient contains an upper/lower case combination of 'false'. The version at block returns a block containing the string as a message. This message is called by the 'as:' message at String.

Type: Method          Returns: Object

Also Defined At:
| Block | Boolean | Number | Object | String | Undefined |

o count30DayDaysTo:

Synopsis:
Date count30DayDaysTo: aDate

Description:

Counts the number of days between original date and date supplied, assuming all months have 30 days. Assumes original date is earlier than date supplied. Used primarily in yield-to-maturity type applications.

Type: Method          Returns: Number

Parameters:

1 - Date

o count360DayYearsTo:

Synopsis:
Date count360DayYearsTo: aDate

Description:

Counts the number of years between original date and date supplied, assuming all months have 30 days (all years have 360 days). Assumes original date is earlier than date supplied. Used primarily in yield-to-maturity type applications.

Type: Method          Returns: Number

Parameters:

1 - Date

o count6monthIntervalsTo:

Synopsis:
Date count6monthIntervalsTo: aDate

Description:

Counts the number of 6 month intervals between two dates. Assumes original date is earlier than supplied date. Used primarily in bond applications - interpreted as number of full coupon payments remaining. Assumes end point is at a six month interval.

Type: Method          Returns: Number

Parameters:

1 - Date

o countBDaysTo:

Synopsis:
Date countBDaysTo: aDate

Description:

Counts the number of business days between recipient date and date supplied.

Type: Method          Returns: Number

Parameters:

1 - Date

o countDaysTo:

Synopsis:
Date countDaysTo: aDate

Description:

Counts the number of days between recipient date and date supplied.

Type: Method          Returns: Number

Parameters:

1 - Date

o countFullMonthsTo:

Synopsis:
Date countFullMonthsTo: aDate

Description:

Computes number of FULL months between two dates.

Type: Method          Returns: Number

Parameters:

1 - Date

o countIntervalsOf:to:

Synopsis:
Date countIntervalsOf: aDateOffset to: aDate

Description:

Counts the number of full intervals between recipient date and date supplied

Type: Method          Returns: Number

Parameters:

1 - DateOffset
2 - Date

o countMonthsTo:

Synopsis:
Date countMonthsTo: aDate

Description:

Computes number of months between two dates.

Type: Method          Returns: Number

Parameters:

1 - Date

o countYearsTo:

Synopsis:
Date countYearsTo: aDate

Description:

Computes the number of years (full and fractional) between two dates. A full year is assumed to have 365.25 days.

Type: Method          Returns: Number

Parameters:

1 - Date

o day

Synopsis:
Date day

Description:

Returns the 'day' portion of recipient date.

Type: Primitive          Returns: Integer

o dayNumberOfWeek

Synopsis:
Date dayNumberOfWeek

Description:

Returns a number (1 - 7) indicating recipient's day of week. 1 is Monday; 7 is Sunday.

Type: Method          Returns: Integer

o dayOfWeek

Synopsis:
Date dayOfWeek

Description:

Returns day of week as a string (e.g. Monday).

Type: Method          Returns: String

o defaultInstance

Synopsis:
Ordinal defaultInstance

Description:

Returns the default instance of the recipient object's class

Type: Constant          Returns: Ordinal

Also Defined At:
| Block | Boolean | Classification | Collection | Currency | Date | DateOffset | DateRange | Dictionary | Entity | IndexedList | Interface | List | Number | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o defaultInstance

Synopsis:
Date defaultInstance

Description:

Returns the default instance of the recipient object's class

Type: Constant          Returns: Date

Also Defined At:
| Block | Boolean | Classification | Collection | Currency | DateOffset | Dictionary | Entity | IndexedList | Interface | List | Number | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o evaluate:

Synopsis:
Date evaluate: aBlock

Description:

Evaluates all statements in the block as of recipient date. The recipient date becomes the default inside the block (changing the value of the magic word ^date). The default date would otherwise be the current date (accessible by the magic word ^today).

Type: Primitive          Returns: Date

Parameters:

1 - Block

Also Defined At:
| Currency | DateOffset |

o extract:for:

Synopsis:
Date extract: block for: object

Description:

This message evaluates the supplied block for the supplied object and returns the value as of the recipient date.

Type: Method          Returns: Object

Parameters:

1 - Block
2 - Object

o formatUsingLongName

Synopsis:
Date formatUsingLongName

Description:

Returns date as string in the form March 31, 1991.

Type: Method          Returns: String

o formatUsingMMDD

Synopsis:
Date formatUsingMMDD

Description:

Returns date as string in the form 3/31.

Type: Method          Returns: String

o formatUsingMMDDYY

Synopsis:
Date formatUsingMMDDYY

Description:

Returns date as string in the form 3/31/91.

Type: Method          Returns: String

o formatUsingMMDDYYYY

Synopsis:
Date formatUsingMMDDYYYY

Description:

Returns date as string in the form 3/31/1991

Type: Method          Returns: String

o formatUsingShortName

Synopsis:
Date formatUsingShortName

Description:

Returns date as string in the form 31-Mar-1991.

Type: Method          Returns: String

o getDayOfWeekDescriptor

Synopsis:
Date getDayOfWeekDescriptor

Description:

Returns DayOfWeekDescriptor for current date.

Type: Method          Returns: Date DayOfWeekDescriptor

o getMonthDescriptor

Synopsis:
Date getMonthDescriptor

Description:

Returns MonthDescriptor for current date.

Type: Method          Returns: Date MonthDescriptor

o inRange:

Synopsis:
Ordinal Ordinal inRange: aList

Description:

Tests if recipient Ordinal is in range specified by aList, where aList contains 2 elements - the start and end of the range (inclusive).

Type: Method          Returns: Boolean

Parameters:

1 - String

o inSet:

Synopsis:
Ordinal inSet: aList

Description:

Tests if recipient Ordinal is included in supplied list.

Type: Method          Returns: Boolean

Parameters:

1 - String

o inputExpression

Synopsis:
Date inputExpression

Description:

Used by DDMS ToolKit to format recipient as input.

Type: Method          Returns: Object

Also Defined At:
| Number | Object |

o isDate

Synopsis:
Date isDate

Description:

Returns a TRUE value when sent to any date.

Type: Constant          Returns: TRUE

Also Defined At:
| Object |

o isDefault

Synopsis:
Date isDefault

Description:

Returns TRUE if date is earliest possible date.

Type: Method          Returns: Boolean

Also Defined At:
| Collection | Object | String | Undefined |

o isInitialDate

Synopsis:
Date isInitialDate

Description:

Returns TRUE if date is earliest possible date, otherwise returns FALSE.

Type: Method          Returns: Boolean

o isLastBusinessDayOfMonth

Synopsis:
Date isLastBusinessDayOfMonth

Description:

Determines if recipient date is the last business day of the month.

Type: Method          Returns: Boolean

o isMonthEnd

Synopsis:
Date isMonthEnd

Description:

Determines whether recipient date is the last day of the month.

Type: Method          Returns: Boolean

o isOrdinal

Synopsis:
Ordinal isOrdinal

Description:

Returns a TRUE value when sent to any Ordinal.

Type: Constant          Returns: TRUE

Also Defined At:
| Object |

o isValid

Synopsis:
Date isValid

Description:

Returns TRUE if recipient date is greater than or equal to earliest possible date (January 1, 0001).

Type: Method          Returns: Boolean

o isntValid

Synopsis:
Date isntValid

Description:

Returns TRUE if recipient date less than earliest possible date (January 1, 0001).

Type: Method          Returns: Boolean

o max:

Synopsis:
Ordinal max: aNumber

Description:

Computes the larger of the supplied value and the recipient Number. If an invalid parameter is supplied, NA is returned.

Type: Method          Returns: Number

Parameters:

1 - Number

Also Defined At:
| Collection | Undefined |

o min:

Synopsis:
Ordinal min: aNumber

Description:

Computes the smaller of the supplied value and the recipient Number. If an invalid parameter is supplied, NA is returned.

Type: Method          Returns: Number

Parameters:

1 - Number

Also Defined At:
| Collection | Undefined |

o month

Synopsis:
Date month

Description:

Returns the 'month' portion of recipient date.

Type: Primitive          Returns: Integer

o new

Synopsis:
Ordinal new

Description:

Undefines the 'new' message for Ordinal classes.

Type: Method          Returns: Ordinal

Also Defined At:
| Boolean | Collection | DateRange | Dictionary | Object | Undefined |

o notBetween:and:

Synopsis:
Ordinal notBetween: anOrdinal1 and: anOrdinal2

Description:

Tests if recipient Ordinal is not between supplied Ordinal1 and supplied Ordinal2.

Type: Method          Returns: Boolean

Parameters:

1 - String
2 - String

Also Defined At:
| Undefined |

o print

Synopsis:
Date print

Description:

Redefines the standard print message so that the value of the recipient date is printed.

Type: Primitive          Returns: Date

Also Defined At:
| Block | DateOffset | Entity | IndexedList | List | Object | String | TimeSeries | Undefined |

o print:

Synopsis:
Date print: anInteger

Description:

Prints the recipient date using the supplied format. If the width is less than 8 characters, the format is mm/yy padded with spaces at the right. If the width is 8 characters, the format is mm/dd/yy. If the width is 9 characters, the format is mm/dd/yy_. Otherwise, the format is mm/dd/yyyy padded with spaces at the right.

Type: Method          Returns: Date

Parameters:

1 - Integer

Also Defined At:
| Boolean | Entity | Number | Object | String | Undefined |

o quarterNumber

Synopsis:
Date quarterNumber

Description:

Returns the quarter (1-4) of the recipient date.

Type: Method          Returns: Integer

o to:by:

Synopsis:
Date to: aDate by: aDateOffset

Description:

Produces a Date Range from two Dates and a Date Increment supplied. Dates can be in ascending or descending order.

Type: Method          Returns: DateRange

Parameters:

1 - Date
2 - DateOffset

o whatAmI

Synopsis:
Ordinal whatAmI

Description:

Returns the string 'Ordinal'.

Type: Constant          Returns: String

Also Defined At:
| Block | Boolean | Classification | Collection | Currency | Date | DateOffset | DateRange | Dictionary | Entity | IndexedList | Interface | List | Number | Object | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o whatAmI

Synopsis:
Date whatAmI

Description:

Returns the string 'Date'.

Type: Constant          Returns: String

Also Defined At:
| Block | Boolean | Classification | Collection | Currency | DateOffset | Dictionary | Entity | IndexedList | Interface | List | Number | Object | OpenVision | Schema | String | TimeSeries | Undefined | Utility |

o year

Synopsis:
Date year

Description:

Retuns the 'year' portion of recipient date.

Type: Primitive          Returns: Integer