3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Draw_time = "29/01/2016 7pm"; $date = DateTime::createFromFormat("d/m/Y ha",$Draw_time); $new_date = $date->format('Y-m-d H:i:s'); $date2 = new DateTime(); echo $diff = $date2->diff($date)->format("%a");
based on V4nnt
Output for 5.3.22 - 5.4.45, 5.6.28, 7.0.20 - 7.3.0alpha1
2
Output for 7.0.6
112
Output for 7.0.5
64
Output for 7.0.4
41
Output for 7.0.3
49
Output for 7.0.2
53
Output for 7.0.1
54
Output for 7.0.0
57
Output for 5.6.21
93
Output for 5.6.20
71
Output for 5.6.19
38
Output for 5.6.18
45
Output for 5.6.17
50
Output for 5.6.16
58
Output for 5.6.15
59
Output for 5.6.14
75
Output for 5.6.13
77
Output for 5.6.12
81
Output for 5.6.11
85
Output for 5.6.10
86
Output for 5.6.9
89
Output for 5.6.8
91
Output for 5.5.35
114
Output for 5.5.34
72
Output for 5.5.33
39
Output for 5.5.32
48
Output for 5.5.31
51
Output for 5.5.30
62
Output for 5.5.29
78
Output for 5.5.28
82
Output for 5.5.27
83
Output for 5.5.26
88
Output for 5.5.25
90
Output for 5.5.24
115