47 of 110 menu

PHP Date and Time

To display the current date and time in a specified format, use the date function.

The format is specified using control commands (English letters), and any separators can be inserted between them (hyphens, colons, and so on).

Let's output the current date-time in the format 'hours:minutes:seconds day.month.year':

<?php echo date('H:i:s d.m.Y'); ?>

You can see all the commands in the PHP Manual, here: the date function.

English
БеларускаяEspañolРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline