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 "PM 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');
based on Ud1ut
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 AMPM time 28 Sep 15 13:00 28 Sep 15 01:00 PM
Output for 7.0.6
AM time 03 May 16 01:00 03 May 16 01:00 AMPM time 03 May 16 13:00 03 May 16 01:00 PM
Output for 7.0.5
AM time 02 Apr 16 01:00 02 Apr 16 01:00 AMPM time 02 Apr 16 13:00 02 Apr 16 01:00 PM
Output for 7.0.4
AM time 10 Mar 16 01:00 10 Mar 16 01:00 AMPM time 10 Mar 16 13:00 10 Mar 16 01:00 PM
Output for 7.0.3
AM time 18 Mar 16 01:00 18 Mar 16 01:00 AMPM time 18 Mar 16 13:00 18 Mar 16 01:00 PM
Output for 7.0.2
AM time 21 Mar 16 01:00 21 Mar 16 01:00 AMPM time 21 Mar 16 13:00 21 Mar 16 01:00 PM
Output for 7.0.1
AM time 23 Mar 16 01:00 23 Mar 16 01:00 AMPM time 23 Mar 16 13:00 23 Mar 16 01:00 PM
Output for 7.0.0
AM time 26 Mar 16 01:00 26 Mar 16 01:00 AMPM time 26 Mar 16 13:00 26 Mar 16 01:00 PM
Output for 5.6.21
AM time 02 May 16 01:00 02 May 16 01:00 AMPM time 02 May 16 13:00 02 May 16 01:00 PM
Output for 5.6.20
AM time 09 Apr 16 01:00 09 Apr 16 01:00 AMPM time 09 Apr 16 13:00 09 Apr 16 01:00 PM
Output for 5.6.19
AM time 07 Mar 16 01:00 07 Mar 16 01:00 AMPM time 07 Mar 16 13:00 07 Mar 16 01:00 PM
Output for 5.6.18
AM time 14 Mar 16 01:00 14 Mar 16 01:00 AMPM time 14 Mar 16 13:00 14 Mar 16 01:00 PM
Output for 5.6.17
AM time 19 Mar 16 01:00 19 Mar 16 01:00 AMPM time 19 Mar 16 13:00 19 Mar 16 01:00 PM
Output for 5.6.16
AM time 27 Mar 16 01:00 27 Mar 16 01:00 AMPM time 27 Mar 16 13:00 27 Mar 16 01:00 PM
Output for 5.6.15
AM time 28 Mar 16 01:00 28 Mar 16 01:00 AMPM time 28 Mar 16 13:00 28 Mar 16 01:00 PM
Output for 5.6.14
AM time 01 Apr 16 01:00 01 Apr 16 01:00 AMPM time 01 Apr 16 13:00 01 Apr 16 01:00 PM
Output for 5.6.13
AM time 15 Apr 16 01:00 15 Apr 16 01:00 AMPM time 15 Apr 16 13:00 15 Apr 16 01:00 PM
Output for 5.6.12
AM time 19 Apr 16 01:00 19 Apr 16 01:00 AMPM time 19 Apr 16 13:00 19 Apr 16 01:00 PM
Output for 5.6.11
AM time 22 Apr 16 01:00 22 Apr 16 01:00 AMPM time 22 Apr 16 13:00 22 Apr 16 01:00 PM
Output for 5.6.10
AM time 25 Apr 16 01:00 25 Apr 16 01:00 AMPM time 25 Apr 16 13:00 25 Apr 16 01:00 PM
Output for 5.6.9
AM time 27 Apr 16 01:00 27 Apr 16 01:00 AMPM time 27 Apr 16 13:00 27 Apr 16 01:00 PM
Output for 5.6.8
AM time 29 Apr 16 01:00 29 Apr 16 01:00 AMPM time 29 Apr 16 13:00 29 Apr 16 01:00 PM
Output for 5.6.7
AM time 25 May 16 01:00 25 May 16 01:00 AMPM time 25 May 16 13:00 25 May 16 01:00 PM
Output for 5.5.35
AM time 22 May 16 01:00 22 May 16 01:00 AMPM time 22 May 16 13:00 22 May 16 01:00 PM
Output for 5.5.34
AM time 10 Apr 16 01:00 10 Apr 16 01:00 AMPM time 10 Apr 16 13:00 10 Apr 16 01:00 PM
Output for 5.5.33
AM time 08 Mar 16 01:00 08 Mar 16 01:00 AMPM time 08 Mar 16 13:00 08 Mar 16 01:00 PM
Output for 5.5.32
AM time 16 Mar 16 01:00 16 Mar 16 01:00 AMPM time 16 Mar 16 13:00 16 Mar 16 01:00 PM
Output for 5.5.31
AM time 20 Mar 16 01:00 20 Mar 16 01:00 AMPM time 20 Mar 16 13:00 20 Mar 16 01:00 PM
Output for 5.5.30
AM time 31 Mar 16 01:00 31 Mar 16 01:00 AMPM time 31 Mar 16 13:00 31 Mar 16 01:00 PM
Output for 5.5.29
AM time 16 Apr 16 01:00 16 Apr 16 01:00 AMPM time 16 Apr 16 13:00 16 Apr 16 01:00 PM
Output for 5.5.28
AM time 20 Apr 16 01:00 20 Apr 16 01:00 AMPM time 20 Apr 16 13:00 20 Apr 16 01:00 PM
Output for 5.5.27
AM time 21 Apr 16 01:00 21 Apr 16 01:00 AMPM time 21 Apr 16 13:00 21 Apr 16 01:00 PM
Output for 5.5.26
AM time 26 Apr 16 01:00 26 Apr 16 01:00 AMPM time 26 Apr 16 13:00 26 Apr 16 01:00 PM
Output for 5.5.25
AM time 28 Apr 16 01:00 28 Apr 16 01:00 AMPM time 28 Apr 16 13:00 28 Apr 16 01:00 PM
Output for 5.5.24
AM time 23 May 16 01:00 23 May 16 01:00 AMPM time 23 May 16 13:00 23 May 16 01:00 PM
Output for 5.4.2 - 5.4.7
AM time 27 Oct 15 01:00 27 Oct 15 01:00 AMPM time 27 Oct 15 13:00 27 Oct 15 01:00 PM
Output for 5.3.18 - 5.3.29
AM time 02 Oct 15 01:00 02 Oct 15 01:00 AMPM time 02 Oct 15 13:00 02 Oct 15 01:00 PM