Time::__serialize()

Provides data to be serialized.

Table of Contents
  1. Description
  2. Example

Description

Time::__serialize(): array;

This method will be called when a Time instance is serialized using the built-in PHP serialize() function.

Example

$time = new Time;

echo serialize($time); // Returns `'O:4:"Time":3:{s:6:"parent";N;s:5:"value";s:19:"2026-04-16 19:32:11";s:4:"zone";s:12:"Asia/Jakarta";}'`

Time::__serialize()

Provides data to be serialized.

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.