Time::day()

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

Table of Contents
  1. Description
  2. Example

Description

Time::day(?array|string $type = null): mixed;

This method returns the day number of the week, 2 digits with leading zeros. It can also returns the day name if you pass a string or array of strings to the first method argument.

Example

$time = new Time;

echo $time->day(); // Returns `'02'`
echo $time->day(""); // Returns `'Tuesday'`
echo $time->day('asdf'); // Returns `'Tuesday'`
echo $time->day([
    'Friday' => 'Jumat',
    'Monday' => 'Senin',
    'Saturday' => 'Sabtu',
    'Sunday' => 'Minggu',
    'Thursday' => 'Kamis',
    'Tuesday' => 'Selasa',
    'Wednesday' => 'Rabu'
]); // Returns `'Selasa'`

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.