Class Date

Description

Instances of Date are Timespans with duration of 1 day.

Their default creation assumes a start of midnight in the local time zone.

To create new Date instances, use one of the static instance-creation methods, NOT 'new Date':

    Located in /harmoni/core/Primitives/Chronology/Date.class.php (line 48)

    SObject
       |
       --Magnitude
          |
          --Timespan
             |
             --Date
    Method Summary
    object Date addDays (integer $anInteger)
    integer asSeconds ()
    object Date current ([optional $class = 'Date'])
    object Date epoch ([optional $class = 'Date'])
    object Date fromString (string $aString, [optional $class = 'Date'])
    string mmddyyyyString ()
    object Date previousDayNamed (string $dayNameString)
    string printableString ()
    string printableStringWithFormat (array $formatArray)
    object Date starting (object DateAndTime $aDateAndTime, [mixed $class = 'Date'])
    object Year startingDuration (object DateAndTime $aDateAndTime, object Duration $aDuration, [optional $class = 'Date'])
    object Date subtractDays (integer $anInteger)
    object Date today ([optional $class = 'Date'])
    object Date tomorrow ([mixed $class = 'Date'])
    object Date withJulianDayNumber (integer $anInteger, [mixed $class = 'Date'])
    object Date withYearDay (integer $anIntYear, integer $anIntDay, [mixed $class = 'Date'])
    object Date withYearMonthDay (integer $anIntYear, integer $anIntOrStringMonth, integer $anIntDay, [mixed $class = 'Date'])
    object Date yesterday ([optional $class = 'Date'])
    string yyyymmddString ()
    Variables

    Inherited Variables

    Inherited from Timespan

    Timespan::$duration
    Timespan::$start
    Methods
    addDays (line 377)

    Answer the date that occurs $anInteger days from this date

    • since: 5/20/05
    • access: public
    object Date addDays (integer $anInteger)
    • integer $anInteger
    asDate (line 424)

    Answer the reciever as a Date

    • since: 5/23/05
    • access: public
    object Date asDate ()

    Redefinition of:
    Timespan::asDate()
    Answer this instance converted.
    asSeconds (line 435)

    Answer the seconds since the Squeak epoch: 1 January 1901

    • since: 5/23/05
    • access: public
    integer asSeconds ()
    current (line 81)

    Answer a new object that represents now.

    • static:
    • since: 5/5/05
    • access: public
    object Date current ([optional $class = 'Date'])
    • optional $class: string $class DO NOT USE OUTSIDE OF PACKAGE. This parameter is used to get around the limitations of not being able to find the class of the object that recieved the initial method call.

    Redefinition of:
    Timespan::current()
    Answer a new object that represents now.
    epoch (line 98)

    Answer a Date starting on the Squeak epoch: 1 January 1901

    • static:
    • since: 5/5/05
    • access: public
    object Date epoch ([optional $class = 'Date'])
    • optional $class: string $class DO NOT USE OUTSIDE OF PACKAGE. This parameter is used to get around the limitations of not being able to find the class of the object that recieved the initial method call.

    Redefinition of:
    Timespan::epoch()
    Answer a Timespan starting on the Squeak epoch: 1 January 1901
    fromString (line 124)

    Read a Date from the stream in any of the forms:

    • <day> <monthName> <year> (5 April 1982; 5-APR-82)
    • <monthName> <day> <year> (April 5, 1982)
    • <monthNumber> <day> <year> (4/5/82)
    • <day><monthName><year> (5APR82)
    • <four-digit year><two-digit monthNumber><two-digit day> (19820405; 1982-04-05)

    • since: 5/10/05
    • access: public
    object Date fromString (string $aString, [optional $class = 'Date'])
    • string $aString
    • optional $class: string $class DO NOT USE OUTSIDE OF PACKAGE. This parameter is used to get around the limitations of not being able to find the class of the object that recieved the initial method call.
    mmddyyyyString (line 271)

    Answer the receiver rendered in standard U.S.A format mm/dd/yyyy.

    • since: 5/23/05
    • access: public
    string mmddyyyyString ()
    previousDayNamed (line 405)

    Answer the previous date whose weekday name is dayName.

    • since: 5/23/05
    • access: public
    object Date previousDayNamed (string $dayNameString)
    • string $dayNameString
    printableString (line 282)

    Format is '4 June 2005'

    • since: 5/20/05
    • access: public
    string printableString ()

    Redefinition of:
    Timespan::printableString()
    Return a printable string
    printableStringWithFormat (line 309)

    Print a description of the receiver on aStream using the format denoted the argument, formatArray:

    array(item, item, item, sep, monthfmt, yearfmt, twoDigits)

    items: 1=day 2=month 3=year will appear in the order given,

    separated by sep which is eaither an ascii code or character.

    monthFmt: 1=09 2=Sep 3=September

    yearFmt: 1=1996 2=96

    digits: (missing or)1=9 2=09.

    See the examples in printOn: and mmddyy

    • since: 5/20/05
    • access: public
    string printableStringWithFormat (array $formatArray)
    • array $formatArray
    starting (line 146)

    Create a new object starting now, with our default one day duration

    • static:
    • since: 5/5/05
    • access: public
    object Date starting (object DateAndTime $aDateAndTime, [mixed $class = 'Date'])

    Redefinition of:
    Timespan::starting()
    Create a new object starting now, with zero duration
    startingDuration (line 167)

    Create a new object starting from midnight

    • static:
    • since: 5/5/05
    • access: public
    object Year startingDuration (object DateAndTime $aDateAndTime, object Duration $aDuration, [optional $class = 'Date'])
    • object DateAndTime $aDateAndTime
    • object Duration $aDuration
    • optional $class: string $class DO NOT USE OUTSIDE OF PACKAGE. This parameter is used to get around the limitations of not being able to find the class of the object that recieved the initial method call.

    Redefinition of:
    Timespan::startingDuration()
    Create a new object
    subtractDays (line 392)

    Answer the date that occurs $anInteger days before this date

    • since: 5/23/05
    • access: public
    object Date subtractDays (integer $anInteger)
    • integer $anInteger
    today (line 183)

    Answer today's date

    • since: 5/10/05
    • access: public
    object Date today ([optional $class = 'Date'])
    • optional $class: string $class DO NOT USE OUTSIDE OF PACKAGE. This parameter is used to get around the limitations of not being able to find the class of the object that recieved the initial method call.
    tomorrow (line 195)

    Answer tommorow's date

    • since: 5/10/05
    • access: public
    object Date tomorrow ([mixed $class = 'Date'])
    withJulianDayNumber (line 209)

    Create a new object starting on the julian day number specified.

    • since: 5/10/05
    • access: public
    object Date withJulianDayNumber (integer $anInteger, [mixed $class = 'Date'])
    • integer $anInteger
    withYearDay (line 238)

    Create a new object starting on the year and day of year specified.

    • since: 5/10/05
    • access: public
    object Date withYearDay (integer $anIntYear, integer $anIntDay, [mixed $class = 'Date'])
    • integer $anIntYear
    • integer $anIntDay
    withYearMonthDay (line 224)

    Create a new object starting on the year, month, and day of month specified.

    • since: 5/10/05
    • access: public
    object Date withYearMonthDay (integer $anIntYear, integer $anIntOrStringMonth, integer $anIntDay, [mixed $class = 'Date'])
    • integer $anIntYear
    • integer $anIntOrStringMonth
    • integer $anIntDay
    yesterday (line 254)

    Answer yesterday's date

    • since: 5/10/05
    • access: public
    object Date yesterday ([optional $class = 'Date'])
    • optional $class: string $class DO NOT USE OUTSIDE OF PACKAGE. This parameter is used to get around the limitations of not being able to find the class of the object that recieved the initial method call.
    yyyymmddString (line 361)

    Format the date in ISO 8601 standard like '2002-10-22'.

    • since: 5/23/05
    • access: public
    string yyyymmddString ()

    Inherited Methods

    Inherited From Timespan

    Timespan::Timespan()
    Timespan::asDate()
    Timespan::asDateAndTime()
    Timespan::asDuration()
    Timespan::asMonth()
    Timespan::asTime()
    Timespan::asTimeStamp()
    Timespan::asWeek()
    Timespan::asYear()
    Timespan::current()
    Timespan::dates()
    Timespan::day()
    Timespan::dayOfMonth()
    Timespan::dayOfWeek()
    Timespan::dayOfWeekName()
    Timespan::dayOfYear()
    Timespan::daysInMonth()
    Timespan::daysInYear()
    Timespan::daysLeftInYear()
    Timespan::duration()
    Timespan::end()
    Timespan::epoch()
    Timespan::every()
    Timespan::firstDayOfMonth()
    Timespan::includes()
    Timespan::includesAllOf()
    Timespan::includesAnyOf()
    Timespan::intersection()
    Timespan::isEqualTo()
    Timespan::isLeapYear()
    Timespan::isLessThan()
    Timespan::julianDayNumber()
    Timespan::minus()
    Timespan::months()
    Timespan::next()
    Timespan::plus()
    Timespan::previous()
    Timespan::printableString()
    Timespan::setDuration()
    Timespan::setStart()
    Timespan::start()
    Timespan::starting()
    Timespan::startingDuration()
    Timespan::startingEnding()
    Timespan::startMonth()
    Timespan::startMonthAbbreviation()
    Timespan::startMonthIndex()
    Timespan::startMonthName()
    Timespan::startYear()
    Timespan::to()
    Timespan::union()
    Timespan::weeks()
    Timespan::years()

    Inherited From Magnitude

    Magnitude::isBetween()
    Magnitude::isEqualTo()
    Magnitude::isGreaterThan()
    Magnitude::isGreaterThanOrEqualTo()
    Magnitude::isLessThan()
    Magnitude::isLessThanOrEqualTo()
    Magnitude::max()
    Magnitude::min()

    Inherited From SObject

    SObject::asA()
    SObject::asString()
    SObject::copy()
    SObject::copySameFrom()
    SObject::copyTwoLevel()
    SObject::deepCopy()
    SObject::isEqual()
    SObject::isEqualTo()
    SObject::isNotEqualTo()
    SObject::isNotReferenceTo()
    SObject::isReferenceTo()
    SObject::newFrom()
    SObject::postCopy()
    SObject::printableString()
    SObject::shallowCopy()
    SObject::_deepCopyArray()

    Documentation generated on Wed, 19 Sep 2007 10:22:32 -0400 by phpDocumentor 1.3.0RC3