Time::day()
Returns the day number of the week, or the day name.
Table of Contents
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::_()
The dynamic method initiator.
Time::__call()
Proxy for missing methods.
Time::__callStatic()
Proxy for missing static methods.
Time::__construct()
The constructor.
Time::__get()
Proxy for missing properties.
Time::__invoke()
Proxy for the current object, called as a function.
Time::__serialize()
Provides data to be serialized.
Time::__toString()
Proxy for the current object, casted as a string.
Time::__unserialize()
Converts the serialized data back to its object.
Time::date()
Returns the day of the month.
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::from()
Object instantiator.
Time::hour()
Returns the hour number.
Time::i()
Returns the date/time formatted according to the given pattern.
Time::minute()
Returns the minute number.
Time::month()
Returns the month number, or the month name.
Time::name()
Returns the date/time format as a valid file name.
Time::second()
Returns the second number.
Time::to()
Converts current date/time zone to other date/time zone.
Time::year()
Returns the year number.