Time::name()

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

Table of Contents
  1. Description
  2. Example

Description

Time::name(string $join = '-'): string;

This method returns the date/time format as a valid file name. It can then be used to name files safely.

Example

$time = new Time;

echo $time->name(); // Returns `'2026-02-03-07-27-24'`
echo $time->name('.'); // Returns `'2026.02.03.07.27.24'`

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.