date
date — Format a local time/date.Description
date( string $format,Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given. In other words, timestamp is optional and defaults to the value of time().
int|null $timestamp = null ): string
Parameters
format
Format accepted by DateTimeInterface::format().
timestamp
The optional timestamp parameter is an int Unix timestamp that defaults to the current local time if timestamp is omitted or null. In other words, it defaults to the value of time().
Return Values
Returns a formatted date string. If a non-numeric value is used for timestamp, false is returned and an E_WARNING level error is emitted.More information about date on official PHP documentation site
date - Popular snippets
- PHP 8.1 / MySQL 5.7 date strtotime time floor
last run:
2022-08-10 18:42:58
38
- PHP 8.0 / MySQL 8.0 strtotime date
last run:
2022-10-06 09:38:07
32
- PHP 8.0 / MySQL 5.7 time date printf
last run:
2023-11-10 16:42:55
26
- PHP 8.0 / MySQL 5.7 date
last run:
2021-08-23 20:19:24
25
- PHP 8.1 / MySQL 5.7 date strtotime floor
last run:
2022-08-10 19:39:49
22
- PHP 8.1 / MySQL 5.7 file_get_contents json_decode date
last run:
2023-10-25 16:02:10
21
- PHP 8.1 / MySQL 5.7 date
last run:
2024-04-15 11:11:56
19
- PHP 8.0 / MySQL 5.7 mt_rand strtotime array_map date array_column max array_keys
last run:
2023-10-31 14:44:52
18
- PHP 8.0 / MySQL 8.0 date printf
last run:
2023-11-09 08:56:41
17
- PHP 8.0 / MySQL 5.7 date
last run:
2021-05-10 14:43:28
16
date - New snippets
-
PHP 8.1 / MySQL 5.7 date
added at:
2024-11-29 06:34:35
1
-
PHP 8.1 / MySQL 5.7 date
added at:
2024-11-29 05:44:47
1
-
PHP 8.1 / MySQL 5.7 date implode
added at:
2024-11-28 05:14:25
1
-
PHP 8.1 / MySQL 5.7 date get_current_user
added at:
2024-11-28 03:14:36
1
-
PHP 8.1 / MySQL 5.7 date
added at:
2024-11-28 03:03:25
1
-
PHP 8.1 / MySQL 5.7 date
added at:
2024-11-28 03:03:05
1
-
PHP 8.1 / MySQL 5.7 date
added at:
2024-11-27 05:05:29
4
-
PHP 8.1 / MySQL 5.7 date
added at:
2024-11-27 02:22:07
1
-
PHP 8.1 / MySQL 5.7 date
added at:
2024-11-27 02:19:44
8
-
PHP 8.1 / MySQL 5.7 date
added at:
2024-11-27 02:17:57
1