Time::year()

Returns the year number.

Table of Contents
  1. Description
  2. Example

Description

Time::year(): string;

This method returns the year number.

Example

$time = new Time;

echo $time->year(); // Returns `'2026'`

Time::day()

Returns the day number of the week, or the day name.

Time::format()

Returns the date/time formatted according to the given format.

Time::i()

Returns the date/time formatted according to the given pattern.

Time::name()

Returns the date/time format as a valid file name.

Time::to()

Converts current date/time zone to other date/time zone.

Time::year()

Returns the year number.