Class CalendarDate
A date on the form YYYY-MM-DD according to the Gregorian calendar.
This class describes a calendar date as defined by ISO 8601.
-
Apptus\ESales\Connector\Time\IsoDate
-
Apptus\ESales\Connector\Time\CalendarDate
Methods summary
public
|
#
__construct( integer $year, integer|null $month, integer|null $day )
Creates a new calendar date with the specified year, month and day.
Creates a new calendar date with the specified year, month and day.
The day or the day and month may be omitted for less precision.
Parameters
- $year
- year, e.g. 2001.
- $month
- month, e.g. Month::JANUARY, or null.
- $day
- day in month, e.g. 4.
Throws
|
public
integer
|
#
year( )
Returns the year. Never returns null.
Returns the year. Never returns null.
Returns
integer
|
public
integer|null
|
#
month( )
Returns the month, if specified at creation. Otherwise returns null.
Returns the month, if specified at creation. Otherwise returns null.
Returns
integer|null
|
public
integer|null
|
#
day( )
Returns the day in month, if specified at creation. Otherwise returns null.
Returns the day in month, if specified at creation. Otherwise returns null.
Returns
integer|null
|
public
string
|
#
__toString( )
Returns a string with an ISO 8601 representation of this date.
Returns a string with an ISO 8601 representation of this date.
Returns
string An ISO 8601 representation of this date.
|
public
Apptus\ESales\Connector\Time\TimePoint
|
#
toTimePoint( Apptus\ESales\Connector\Time\Time $t, DateTimeZone $tz )
Returns a point in time represented by this date and a supplied time of day.
Returns a point in time represented by this date and a supplied time of day.
If the date or time lacks precision, or if the time is omitted, then the
smallest valid point in time for this specification is used.
Parameters
- $t
- time of day. May be null.
- $tz
- timezone.
Returns
|
public
|
|