3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "AM time:\n"; $am = DateTime::createFromFormat('h:i A','1:00 AM'); echo $am->format('d M y H:i')."\n"; echo $am->format('d M y h:i A'); echo "\n\nPM time:\n"; $pm = DateTime::createFromFormat('h:i A','1:00 PM'); echo $pm->format('d M y H:i')."\n"; echo $pm->format('d M y h:i A'); var_dump(DateTime::createFromFormat('h:i A','1:00 AM')->getTimestamp());
based on kBNl4
Output for 5.4.8 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
AM time: 28 Sep 15 01:00 28 Sep 15 01:00 AM PM time: 28 Sep 15 13:00 28 Sep 15 01:00 PMint(1443394800)
Output for 7.0.6
AM time: 03 May 16 01:00 03 May 16 01:00 AM PM time: 03 May 16 13:00 03 May 16 01:00 PMint(1462230000)
Output for 5.6.14, 7.0.5
AM time: 02 Apr 16 01:00 02 Apr 16 01:00 AM PM time: 02 Apr 16 13:00 02 Apr 16 01:00 PMint(1459551600)
Output for 7.0.4
AM time: 10 Mar 16 01:00 10 Mar 16 01:00 AM PM time: 10 Mar 16 13:00 10 Mar 16 01:00 PMint(1457568000)
Output for 7.0.3
AM time: 18 Mar 16 01:00 18 Mar 16 01:00 AM PM time: 18 Mar 16 13:00 18 Mar 16 01:00 PMint(1458259200)
Output for 7.0.2
AM time: 22 Mar 16 01:00 22 Mar 16 01:00 AM PM time: 22 Mar 16 13:00 22 Mar 16 01:00 PMint(1458604800)
Output for 7.0.1
AM time: 23 Mar 16 01:00 23 Mar 16 01:00 AM PM time: 23 Mar 16 13:00 23 Mar 16 01:00 PMint(1458691200)
Output for 7.0.0
AM time: 26 Mar 16 01:00 26 Mar 16 01:00 AM PM time: 26 Mar 16 13:00 26 Mar 16 01:00 PMint(1458950400)
Output for 5.6.21
AM time: 02 May 16 01:00 02 May 16 01:00 AM PM time: 02 May 16 13:00 02 May 16 01:00 PMint(1462143600)
Output for 5.6.20
AM time: 09 Apr 16 01:00 09 Apr 16 01:00 AM PM time: 09 Apr 16 13:00 09 Apr 16 01:00 PMint(1460156400)
Output for 5.6.19
AM time: 07 Mar 16 01:00 07 Mar 16 01:00 AM PM time: 07 Mar 16 13:00 07 Mar 16 01:00 PMint(1457308800)
Output for 5.6.18
AM time: 14 Mar 16 01:00 14 Mar 16 01:00 AM PM time: 14 Mar 16 13:00 14 Mar 16 01:00 PMint(1457913600)
Output for 5.6.17
AM time: 19 Mar 16 01:00 19 Mar 16 01:00 AM PM time: 19 Mar 16 13:00 19 Mar 16 01:00 PMint(1458345600)
Output for 5.6.16
AM time: 27 Mar 16 01:00 27 Mar 16 01:00 AM PM time: 27 Mar 16 13:00 27 Mar 16 01:00 PMint(1459036800)
Output for 5.6.15
AM time: 28 Mar 16 01:00 28 Mar 16 01:00 AM PM time: 28 Mar 16 13:00 28 Mar 16 01:00 PMint(1459119600)
Output for 5.6.13
AM time: 15 Apr 16 01:00 15 Apr 16 01:00 AM PM time: 15 Apr 16 13:00 15 Apr 16 01:00 PMint(1460674800)
Output for 5.6.12
AM time: 19 Apr 16 01:00 19 Apr 16 01:00 AM PM time: 19 Apr 16 13:00 19 Apr 16 01:00 PMint(1461020400)
Output for 5.6.11
AM time: 23 Apr 16 01:00 23 Apr 16 01:00 AM PM time: 23 Apr 16 13:00 23 Apr 16 01:00 PMint(1461366000)
Output for 5.6.10
AM time: 25 Apr 16 01:00 25 Apr 16 01:00 AM PM time: 25 Apr 16 13:00 25 Apr 16 01:00 PMint(1461538800)
Output for 5.6.9
AM time: 27 Apr 16 01:00 27 Apr 16 01:00 AM PM time: 27 Apr 16 13:00 27 Apr 16 01:00 PMint(1461711600)
Output for 5.6.8
AM time: 29 Apr 16 01:00 29 Apr 16 01:00 AM PM time: 29 Apr 16 13:00 29 Apr 16 01:00 PMint(1461884400)
Output for 5.6.7
AM time: 25 May 16 01:00 25 May 16 01:00 AM PM time: 25 May 16 13:00 25 May 16 01:00 PMint(1464130800)
Output for 5.5.35
AM time: 22 May 16 01:00 22 May 16 01:00 AM PM time: 22 May 16 13:00 22 May 16 01:00 PMint(1463871600)
Output for 5.5.34
AM time: 10 Apr 16 01:00 10 Apr 16 01:00 AM PM time: 10 Apr 16 13:00 10 Apr 16 01:00 PMint(1460242800)
Output for 5.5.33
AM time: 08 Mar 16 01:00 08 Mar 16 01:00 AM PM time: 08 Mar 16 13:00 08 Mar 16 01:00 PMint(1457395200)
Output for 5.5.32
AM time: 16 Mar 16 01:00 16 Mar 16 01:00 AM PM time: 16 Mar 16 13:00 16 Mar 16 01:00 PMint(1458086400)
Output for 5.5.31
AM time: 20 Mar 16 01:00 20 Mar 16 01:00 AM PM time: 20 Mar 16 13:00 20 Mar 16 01:00 PMint(1458432000)
Output for 5.5.30
AM time: 31 Mar 16 01:00 31 Mar 16 01:00 AM PM time: 31 Mar 16 13:00 31 Mar 16 01:00 PMint(1459378800)
Output for 5.5.29
AM time: 16 Apr 16 01:00 16 Apr 16 01:00 AM PM time: 16 Apr 16 13:00 16 Apr 16 01:00 PMint(1460761200)
Output for 5.5.28
AM time: 20 Apr 16 01:00 20 Apr 16 01:00 AM PM time: 20 Apr 16 13:00 20 Apr 16 01:00 PMint(1461106800)
Output for 5.5.27
AM time: 21 Apr 16 01:00 21 Apr 16 01:00 AM PM time: 21 Apr 16 13:00 21 Apr 16 01:00 PMint(1461193200)
Output for 5.5.26
AM time: 26 Apr 16 01:00 26 Apr 16 01:00 AM PM time: 26 Apr 16 13:00 26 Apr 16 01:00 PMint(1461625200)
Output for 5.5.25
AM time: 28 Apr 16 01:00 28 Apr 16 01:00 AM PM time: 28 Apr 16 13:00 28 Apr 16 01:00 PMint(1461798000)
Output for 5.5.24
AM time: 23 May 16 01:00 23 May 16 01:00 AM PM time: 23 May 16 13:00 23 May 16 01:00 PMint(1463958000)
Output for 5.4.2 - 5.4.7
AM time: 27 Oct 15 01:00 27 Oct 15 01:00 AM PM time: 27 Oct 15 13:00 27 Oct 15 01:00 PMint(1445904000)
Output for 5.3.18 - 5.3.29
AM time: 02 Oct 15 01:00 02 Oct 15 01:00 AM PM time: 02 Oct 15 13:00 02 Oct 15 01:00 PMint(1443740400)