<?php
$datetime1 = new DateTime();
$datetime2 = new DateTime('2013-01-03 17:13:00');
$interval = $datetime1->diff($datetime2);
$elapsed = $interval->format('%y years, %m months, %a days, %h hours, %i minutes, %S seconds');
$elapsed = str_replace(array('0 years,', ' 0 months,', ' 0 days,', ' 0 hours,', ' 0 minutes,'), '', $elapsed);
echo $elapsed;
- Output for 5.6.28, 7.0.14 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 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.7
- 1 years, 8 months, 619 days, 20 hours, 44 minutes, 29 seconds
- Output for 7.3.32 - 7.3.33, 8.0.13
- 1 years, 8 months, 619 days, 18 hours, 44 minutes, 29 seconds
- Output for 7.0.6
- 3 years, 3 months, 1215 days, 14 hours, 50 minutes, 25 seconds
- Output for 7.0.5
- 3 years, 2 months, 1185 days, 3 hours, 47 minutes, 31 seconds
- Output for 7.0.4
- 3 years, 2 months, 1161 days, 14 hours, 3 minutes, 38 seconds
- Output for 7.0.3
- 3 years, 2 months, 1169 days, 14 hours, 35 minutes, 45 seconds
- Output for 7.0.2
- 3 years, 2 months, 1173 days, 20 hours, 20 minutes, 59 seconds
- Output for 7.0.1
- 3 years, 2 months, 1175 days, 1 hours, 22 minutes, 47 seconds
- Output for 7.0.0
- 3 years, 2 months, 1178 days, 3 hours, 3 minutes, 16 seconds
- Output for 5.6.21
- 3 years, 3 months, 1214 days, 10 hours, 9 minutes, 40 seconds
- Output for 5.6.20
- 3 years, 3 months, 1192 days, 2 hours, 37 minutes, 29 seconds
- Output for 5.6.19
- 3 years, 2 months, 1158 days, 22 hours, 9 minutes, 31 seconds
- Output for 5.6.18
- 3 years, 2 months, 1166 days, 5 hours, 54 minutes, 54 seconds
- Output for 5.6.17
- 3 years, 2 months, 1170 days, 18 hours, 54 minutes, 08 seconds
- Output for 5.6.16
- 3 years, 2 months, 1179 days, 4 hours, 48 minutes, 35 seconds
- Output for 5.6.15
- 3 years, 2 months, 1180 days, 5 hours, 41 minutes, 44 seconds
- Output for 5.6.14
- 3 years, 2 months, 1184 days, 8 hours, 16 minutes, 13 seconds
- Output for 5.6.13
- 3 years, 3 months, 1197 days, 12 hours, 11 minutes, 41 seconds
- Output for 5.6.12
- 3 years, 3 months, 1202 days, 1 hours, 47 minutes, 48 seconds
- Output for 5.6.11
- 3 years, 3 months, 1205 days, 8 hours, 47 minutes, 04 seconds
- Output for 5.6.10
- 3 years, 3 months, 1207 days, 10 hours, 38 minutes, 19 seconds
- Output for 5.6.9
- 3 years, 3 months, 1209 days, 15 hours, 35 minutes, 39 seconds
- Output for 5.6.8
- 3 years, 3 months, 1211 days, 23 hours, 36 minutes, 01 seconds
- Output for 5.6.7
- 3 years, 4 months, 1237 days, 17 hours, 43 minutes, 39 seconds
- Output for 5.5.35
- 3 years, 4 months, 1234 days, 13 hours, 51 minutes, 07 seconds
- Output for 5.5.34
- 3 years, 3 months, 1193 days, 5 hours, 3 minutes, 57 seconds
- Output for 5.5.33
- 3 years, 2 months, 1160 days, 59 minutes, 22 seconds
- Output for 5.5.32
- 3 years, 2 months, 1168 days, 7 hours, 46 minutes, 34 seconds
- Output for 5.5.31
- 3 years, 2 months, 1171 days, 21 hours, 41 minutes, 20 seconds
- Output for 5.5.30
- 3 years, 2 months, 1183 days, 7 hours, 50 minutes, 12 seconds
- Output for 5.5.29
- 3 years, 3 months, 1199 days, 2 hours, 16 minutes, 39 seconds
- Output for 5.5.28
- 3 years, 3 months, 1203 days, 4 hours, 53 minutes, 53 seconds
- Output for 5.5.27
- 3 years, 3 months, 1204 days, 7 hours, 24 minutes, 22 seconds
- Output for 5.5.26
- 3 years, 3 months, 1208 days, 13 hours, 4 minutes, 11 seconds
- Output for 5.5.25
- 3 years, 3 months, 1210 days, 19 hours, 7 minutes, 28 seconds
- Output for 5.5.24
- 3 years, 4 months, 1236 days, 2 hours, 2 minutes, 44 seconds
- Output for 5.4.45
- 2 years, 8 months, 990 days, 20 hours, 30 minutes, 54 seconds
- Output for 5.4.44
- 2 years, 8 months, 990 days, 20 hours, 30 minutes, 50 seconds
- Output for 5.4.43
- 2 years, 8 months, 990 days, 20 hours, 30 minutes, 42 seconds
- Output for 5.4.42
- 2 years, 8 months, 990 days, 20 hours, 30 minutes, 37 seconds
- Output for 5.4.41
- 2 years, 8 months, 990 days, 20 hours, 30 minutes, 31 seconds
- Output for 5.4.40
- 2 years, 8 months, 990 days, 20 hours, 30 minutes, 23 seconds
- Output for 5.4.39
- 2 years, 8 months, 990 days, 20 hours, 30 minutes, 15 seconds
- Output for 5.4.38
- 2 years, 2 months, 800 days, 1 hours, 2 minutes, 45 seconds
- Output for 5.4.37
- 2 years, 2 months, 800 days, 1 hours, 2 minutes, 38 seconds
- Output for 5.4.34 - 5.4.36
- 2 years, 2 months, 800 days, 1 hours, 2 minutes, 37 seconds
- Output for 5.4.25 - 5.4.32
- 1 years, 8 months, 619 days, 20 hours, 44 minutes, 33 seconds
- Output for 5.4.5 - 5.4.24
- 1 years, 8 months, 619 days, 20 hours, 44 minutes, 34 seconds
- Output for 5.3.15 - 5.3.29, 5.4.0 - 5.4.4
- 1 years, 8 months, 619 days, 20 hours, 44 minutes, 35 seconds
- Output for 5.3.0 - 5.3.14
- 1 years, 8 months, 619 days, 20 hours, 44 minutes, 36 seconds
- Output for 5.2.0 - 5.2.17
- Fatal error: Call to undefined method DateTime::diff() in /in/8h3T6 on line 4
Process exited with code 255. - Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
- Fatal error: Class 'DateTime' not found in /in/8h3T6 on line 2
Process exited with code 255. - Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
- Fatal error: Cannot instantiate non-existent class: datetime in /in/8h3T6 on line 2
Process exited with code 255. - Output for 4.3.0 - 4.3.1
- Fatal error: Cannot instantiate non-existent class: datetime in /in/8h3T6 on line 2
preferences:
208.27 ms | 401 KiB | 314 Q