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-04-16-19-25-52'`
echo $time->name('.'); // Returns `'2026.04.16.19.25.52'`

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.