\duncan3dc\DatesYear

A representation of a year.

Summary

Methods
Properties
Constants
numeric()
string()
format()
now()
addMonths()
subMonths()
addYears()
subYears()
__construct()
getStart()
getEnd()
days()
months()
years()
hours()
minutes()
seconds()
asString()
fromInt()
No public properties found
No constants found
No protected methods found
$unix
$start
$end
N/A
No private methods found
No private properties found
N/A

Properties

$unix

$unix : integer

Type

integer — Unix timestamp representing the datetime of this object

Methods

numeric()

numeric(  $format) : integer

Format the date unsing the specified format and return a number.

Parameters

$format

Returns

integer

string()

string(  $format) : string

Format the date unsing the specified format and return a string.

Parameters

$format

Returns

string

format()

format(  $format) : string|integer

Format the date using the specified format.

This method will convert the result to an integer if it looks like one.

Parameters

$format

Returns

string|integer

now()

now() : static

Create a new range object representing the current date.

Returns

static

addMonths()

addMonths(integer  $months) : static

Get a new Range object for the specified number of months difference.

Parameters

integer $months

The number of months to add

Returns

static

subMonths()

subMonths(integer  $months) : static

Get a new Range object for the specified number of months difference.

Parameters

integer $months

The number of months to subtract

Returns

static

addYears()

addYears(integer  $years) : static

Get a new Range object for the specified number of years difference.

Parameters

integer $years

The number of years to add

Returns

static

subYears()

subYears(integer  $years) : static

Get a new Range object for the specified number of years difference.

Parameters

integer $years

The number of years to subtract

Returns

static

__construct()

__construct(\duncan3dc\Dates\DateTime  $date) 

Create a new instance from a date object.

Parameters

\duncan3dc\Dates\DateTime $date

A date within the season

asString()

asString() : string

Get the range represented in a human readable format.

Returns

string

fromInt()

fromInt(  $year) : static

Create a new instance of the Year class from a numeric 4 digit year.

Parameters

$year

The 4 digit year (eg 2015)

Returns

static