1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
|
function getTimeOfTheDay ($time) {
$h = date('G', $time);
if ($h < 4) {
return __('night');
} elseif ($h < 9) {
return __('morning');
} elseif ($h < 15) {
return __('noon');
} elseif ($h < 18) {
return __('afternoon');
} else {
return __('evening');
}
}
function getDay($time) {
$d = date('N', $time);
switch ($d) {
case 1: return __('Monday');
case 2: return __('Tuesday');
case 3: return __('Wednesday');
case 4: return __('Thursday');
case 5: return __('Friday');
case 6: return __('Saturday');
case 7: return __('Sunday');
}
return null;
} |