<?php
$year = 2012;
$month = 1;
$day = 5;
$date = \DateTimeImmutable::createFromFormat('Y-m-d', "{$year}-{$month}-{$day}");
var_dump($date->format('Y-m-d H:i:s'));
- Output for 5.6.28, 7.0.20, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- string(19) "2012-01-05 16:43:38"
- Output for 7.3.32 - 7.3.33, 8.0.13
- string(19) "2012-01-05 14:43:38"
- Output for 7.0.6
- string(19) "2012-01-05 05:36:08"
- Output for 7.0.5
- string(19) "2012-01-05 18:42:13"
- Output for 7.0.4
- string(19) "2012-01-05 04:37:10"
- Output for 7.0.3
- string(19) "2012-01-05 04:58:18"
- Output for 7.0.2
- string(19) "2012-01-05 15:26:17"
- Output for 7.0.1
- string(19) "2012-01-05 16:02:10"
- Output for 7.0.0
- string(19) "2012-01-05 17:49:46"
- Output for 5.6.21
- string(19) "2012-01-05 00:39:59"
- Output for 5.6.20
- string(19) "2012-01-05 13:57:03"
- Output for 5.6.19
- string(19) "2012-01-05 04:19:44"
- Output for 5.6.18
- string(19) "2012-01-05 17:38:45"
- Output for 5.6.17
- string(19) "2012-01-05 09:22:26"
- Output for 5.6.16
- string(19) "2012-01-05 19:36:03"
- Output for 5.6.15
- string(19) "2012-01-05 20:28:59"
- Output for 5.6.14
- string(19) "2012-01-05 22:59:54"
- Output for 5.6.13
- string(19) "2012-01-05 03:00:48"
- Output for 5.6.12
- string(19) "2012-01-05 16:29:05"
- Output for 5.6.11
- string(19) "2012-01-05 23:25:19"
- Output for 5.6.10
- string(19) "2012-01-05 01:17:17"
- Output for 5.6.9
- string(19) "2012-01-05 06:17:58"
- Output for 5.6.8
- string(19) "2012-01-05 14:09:08"
- Output for 5.6.7
- string(19) "2012-01-05 03:41:38"
- Output for 5.5.35
- string(19) "2012-01-05 04:28:08"
- Output for 5.5.34
- string(19) "2012-01-05 19:55:07"
- Output for 5.5.33
- string(19) "2012-01-05 15:33:17"
- Output for 5.5.32
- string(19) "2012-01-05 21:23:44"
- Output for 5.5.31
- string(19) "2012-01-05 12:13:15"
- Output for 5.5.30
- string(19) "2012-01-05 22:30:18"
- Output for 5.5.29
- string(19) "2012-01-05 17:06:49"
- Output for 5.5.28
- string(19) "2012-01-05 19:31:35"
- Output for 5.5.27
- string(19) "2012-01-05 21:50:43"
- Output for 5.5.26
- string(19) "2012-01-05 03:41:07"
- Output for 5.5.25
- string(19) "2012-01-05 09:37:28"
- Output for 5.5.24
- string(19) "2012-01-05 16:30:48"
- Output for 5.4.2 - 5.4.45
- Fatal error: Class 'DateTimeImmutable' not found in /in/6fGP6 on line 7
Process exited with code 255.
preferences:
189.92 ms | 401 KiB | 226 Q