Answer a Date that represents this object
Answer a DateAndTime that represents this object
Answer a Duration that represents this object, the duration since midnight.
Answer a DateAndTime that represents the object, but at local time.
Answer the month that represents this date's month
Return the number of seconds since the Squeak epoch.
integer
asSeconds
()
Answer a Time that represents our time component
Answer a Timestamp that represents this DateAndTime
Redefined in descendants as:
Answer a DateAndTime equivalent to the reciever, but at UTC (offset = 0)
Answer the week that represents this date's week
Answer the year that represents this date's year
Answer the date and time at midnight on the day of the receiver.
Answer noon on the day of the reciever
Answer the day
integer
day
()
Return an array with the following elements:
'dd' => day of the year 'mm' => month 'yyyy' => year
The algorithm is from Squeak's DateAndTime>>dayMonthYearDo: method.
array
dayMonthYearArray
()
Answer the day of the month
integer
dayOfMonth
()
Answer the day of the week
integer
dayOfWeek
()
Answer the day of the week abbreviation
string
dayOfWeekAbbreviation
()
Answer the day of the week name
string
dayOfWeekName
()
Answer the day of the year
integer
dayOfYear
()
Answer the number of days in the month represented by the receiver.
ingteger
daysInMonth
()
Answer the number of days in the year represented by the receiver.
ingteger
daysInYear
()
Answer the number of days in the year after the date of the receiver.
ingteger
daysLeftInYear
()
Answer the duration of this object (always zero)
Answer a new instance representing the Squeak epoch: 1 January 1901
-
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.
Redefined in descendants as:
Answer the day-in-the-year of the first day of our month
integer
firstDayOfMonth
()
Answer a new instance represented by a string:
- '-1199-01-05T20:33:14.321-05:00'
- ' 2002-05-16T17:20:45.00000001+01:01'
- ' 2002-05-16T17:20:45.00000001'
- ' 2002-05-16T17:20'
- ' 2002-05-16T17:20:45'
- ' 2002-05-16T17:20:45+01:57'
- ' 2002-05-16T17:20:45-02:34'
- ' 2002-05-16T17:20:45+00:00'
- ' 1997-04-26T01:02:03+01:02:3'
-
string
$aString: The input string.
-
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.
Redefined in descendants as:
Answer just 'hh:mm:ss'. This is equivalent to Squeak's printHMSOn: method.
string
hmsString
()
Answer the hours (0-23)
integer
hour
()
Answer an <integer> between 1 and 12, inclusive, representing the hour of the day in the 12-hour clock of the local time of the receiver.
integer
hour12
()
Answer the hours (0-23)
integer
hour24
()
comparand conforms to protocol DateAndTime, or can be converted into something that conforms.
boolean
isEqualTo
(object $comparand)
Redefinition of:
- Magnitude::isEqualTo()
- Test if this is equal to aMagnitude.
Return if this year is a leap year
boolean
isLeapYear
()
comparand conforms to protocol DateAndTime, or can be converted into something that conforms.
boolean
isLessThan
(object $comparand)
Redefinition of:
- Magnitude::isLessThan()
- Test if this is less than aMagnitude.
Return the JulianDayNumber of this DateAndTime
integer
julianDayNumber
()
Answer the duration we are offset from UTC
Answer the local TimeZone
Print just the month, day, and year on aStream.
string
mdyString
()
Return the Meridian Abbreviation ('AM'/'PM')
string
meridianAbbreviation
()
Return a Timespan where the receiver is the middle of the Duration
Answer a new instance starting at midnight local time.
-
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.
Redefined in descendants as:
Subtract a Duration or DateAndTime.
object
minus
(object $operand)
Answer the miniute (0-59)
integer
minute
()
Answer the month
integer
month
()
Answer the day of the week abbreviation
string
monthAbbreviation
()
Answer the index of the month.
integer
monthIndex
()
Answer the name of the month.
string
monthName
()
Answer a new instance starting at noon local time.
-
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.
Redefined in descendants as:
Answer the current date and time.
-
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.
Redefined in descendants as:
Answer a new Duration whose our date + operand. The operand must implement asDuration().
Print as per ISO 8601 sections 5.3.3 and 5.4.1.
If printLeadingSpaceToo is false, prints either: 'YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for positive years) or '-YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for negative years)
If printLeadingSpaceToo is true, prints either: ' YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for positive years) or '-YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for negative years)
This is equivalent to Squeak's printOn:withLeadingSpace: method.
string
printableString
([mixed $printLeadingSpaceToo = FALSE])
Redefinition of:
- SObject::printableString()
- Answer a String whose characters are a description of the receiver.
Redefined in descendants as:
Answer the second (0-59)
integer
second
()
Private - answer an array with our instance variables. Assumed to be UTC
array
ticks
()
Initialize this DateAndTime.
ticks is {julianDayNumber. secondCount. nanoSeconds}
Answer the Time Zone that corresponds to our offset.
Answer the TimeZone abbreviation.
string
timeZoneAbbreviation
()
Answer the TimeZone name.
string
timeZoneName
()
Answer a Timespan. anEnd conforms to protocol DateAndTime or protocol Timespan
Answer a Timespan. anEnd conforms to protocol DateAndTime or protocol Timespan
Answer a new instance representing today
-
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.
Redefined in descendants as:
Answer a new instance representing tomorow
-
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.
Redefined in descendants as:
Answer a <DateAndTime> equivalent to the receiver but offset from UTC by aDuration. This will convert the recievers time, to the time at anOffset; i.e. 11am at UTC-05:00 would become 9am at UTC-7:00 when -7 hours is passed as the offset.
Create a new instance from Date and Time objects
object DateAndTime
withDateAndTime
(
optional $aDate,
mixed $aTime, [
mixed $class =
'DateAndTime'])
-
optional
$aDate: 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.
Redefined in descendants as:
Create a new new instance for a given Julian Day Number.
object DateAndTime
withJulianDayNumber
(
integer $aJulianDayNumber, [
optional $class =
'DateAndTime'])
-
integer
$aJulianDayNumber
-
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.
Redefined in descendants as:
Answer a <DateAndTime> equivalent to the receiver but offset from UTC by aDuration. This will not convert the recievers time, merely change the offset to anOffset; i.e. 11am at UTC-05:00 would become 11am at UTC-7:00 when -7 hours is passed as the offset.
Create a new instance.
void
withYearDay
(integer $anIntYear, integer $anIntDayOfYear, [optional $class = 'DateAndTime'])
-
integer
$anIntYear
-
integer
$anIntDayOfYear
-
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.
Redefined in descendants as:
Create a new instance.
object DateAndTime
withYearDayHourMinuteSecond
(
integer $anIntYear,
integer $anIntDayOfYear,
integer $anIntHour,
integer $anIntMinute,
integer $anIntSecond, [
optional $class =
'DateAndTime'])
-
integer
$anIntYear
-
integer
$anIntDayOfYear
-
integer
$anIntHour
-
integer
$anIntMinute
-
integer
$anIntSecond
-
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.
Redefined in descendants as:
Create a new instance.
object DateAndTime
withYearDayHourMinuteSecondOffset
(
integer $anIntYear,
integer $anIntDayOfYear,
integer $anIntHour,
integer $anIntMinute,
integer $anIntSecond,
object Duration $aDurationOffset, [
optional $class =
'DateAndTime'])
-
integer
$anIntYear
-
integer
$anIntDayOfYear
-
integer
$anIntHour
-
integer
$anIntMinute
-
integer
$anIntSecond
-
object Duration
$aDurationOffset
-
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.
Redefined in descendants as:
Create a new instance.
void
withYearMonthDay
(integer $anIntYear, integer $anIntOrStringMonth, integer $anIntDay, [optional $class = 'DateAndTime'])
-
integer
$anIntYear
-
integer
$anIntOrStringMonth
-
integer
$anIntDay
-
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.
Redefined in descendants as:
Create a new instance.
object DateAndTime
withYearMonthDayHourMinute
(
integer $anIntYear,
integer $anIntOrStringMonth,
integer $anIntDay,
integer $anIntHour,
integer $anIntMinute, [
optional $class =
'DateAndTime'])
-
integer
$anIntYear
-
integer
$anIntOrStringMonth
-
integer
$anIntDay
-
integer
$anIntHour
-
integer
$anIntMinute
-
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.
Redefined in descendants as:
Create a new instance.
object DateAndTime
withYearMonthDayHourMinuteSecond
(
integer $anIntYear,
integer $anIntOrStringMonth,
integer $anIntDay,
integer $anIntHour,
integer $anIntMinute,
integer $anIntSecond, [
optional $class =
'DateAndTime'])
-
integer
$anIntYear
-
integer
$anIntOrStringMonth
-
integer
$anIntDay
-
integer
$anIntHour
-
integer
$anIntMinute
-
integer
$anIntSecond
-
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.
Redefined in descendants as:
Create a new instance.
object DateAndTime
withYearMonthDayHourMinuteSecondOffset
(
integer $anIntYear,
integer $anIntOrStringMonth,
integer $anIntDay,
integer $anIntHour,
integer $anIntMinute,
integer $anIntSecond,
object Duration $aDurationOffset, [
optional $class =
'DateAndTime'])
-
integer
$anIntYear
-
integer
$anIntOrStringMonth
-
integer
$anIntDay
-
integer
$anIntHour
-
integer
$anIntMinute
-
integer
$anIntSecond
-
object Duration
$aDurationOffset
-
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.
Redefined in descendants as:
Answer the year
integer
year
()
Answer a new instance representing yesterday
-
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.
Redefined in descendants as:
Print just the year, month, and day on aStream.
If printLeadingSpaceToo is true, then print as: ' YYYY-MM-DD' (if the year is positive) or '-YYYY-MM-DD' (if the year is negative) otherwise print as: 'YYYY-MM-DD' or '-YYYY-MM-DD'
This is equivalent to Squeak's printYMDOn:withLeadingSpace: method.
string
ymdString
([mixed $printLeadingSpaceToo = FALSE])
Normalize tick values to make things like "2 days, 35 hours" into "3 days, 9 hours".
void
_normalize
(array $ticks, integer $i, integer $base)
-
array
$ticks
-
integer
$i: The index of the array to normalize.
-
integer
$base: The base to normalize to.
Inherited Methods
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()