Login     Sign up
Deporteando (@albertof)
114 months ago
431 Views

1.-where change language :
today and yesterday

2.-where change format date by
day/ month /Year

1 people followed this question
0
  1. function get_date in common.inc.php

[code]
function get_date($timeline, $type = 'time',$timezone = NULL) {
GLOBAL $settings, $client;
if (!isset($timezone)) $timezone = $client['timezone'];
$timeline = $timeline + $timezone3600;
$current = time() + $timezone
3600;
$it_s = intval($current - $timeline);
$it_m = intval($it_s/60);
$it_h = intval($it_m/60);
$it_d = intval($it_h/24);
$it_y = intval($it_d/365);
if ($type == 'date'){
return gmdate($settings['date_format'],$timeline);
}
else {
if(gmdate("j",$timeline) == gmdate("j",$current) && (( $current - $timeline) < 360024)) {
return t($settings['date_today']).', '.gmdate($settings['time_format'],$timeline);
}
elseif(gmdate("j",$timeline) == gmdate("j",($current-3600
24) ) && (( $current - $timeline) < 7200*24)) {
return t($settings['date_yesterday']).', '.gmdate($settings['time_format'],$timeline);
}
return gmdate($settings['date_format'].', '.$settings['time_format'],$timeline);
}
}
[/code]

also fix for an old get_date bug inside

Jcow Master @falcone
114 months ago
@albertof 2. file: my/config.php -> 'date_format' => 'M jS Y',
114 months ago