mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 03:19:05 +02:00
#10945 Fix timestamp
This commit is contained in:
parent
0e8a74a4b8
commit
a8277dc19f
@ -431,7 +431,7 @@ $table->data[$i++][] = html_print_label_input_block(
|
|||||||
|
|
||||||
$table->colspan[$i][] = 2;
|
$table->colspan[$i][] = 2;
|
||||||
$table->data[$i++][] = html_print_label_input_block(
|
$table->data[$i++][] = html_print_label_input_block(
|
||||||
__('Timezone setup'),
|
__('Server timezone setup'),
|
||||||
html_print_div(
|
html_print_div(
|
||||||
[
|
[
|
||||||
'class' => '',
|
'class' => '',
|
||||||
|
@ -538,22 +538,27 @@ if (is_ajax() === true) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone'];
|
$user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone'];
|
||||||
if (!$user_timezone) {
|
if (empty($user_timezone) === true) {
|
||||||
$timezone = timezone_open(date_default_timezone_get());
|
if (date_default_timezone_get() !== $config['timezone']) {
|
||||||
$datetime_eur = date_create('now', timezone_open($config['timezone']));
|
$timezone = timezone_open(date_default_timezone_get());
|
||||||
$dif = timezone_offset_get($timezone, $datetime_eur);
|
$datetime_eur = date_create('now', timezone_open($config['timezone']));
|
||||||
date($config['date_format'], $dif);
|
$dif = timezone_offset_get($timezone, $datetime_eur);
|
||||||
if (!date('I')) {
|
date($config['date_format'], $dif);
|
||||||
// For summer -3600sec.
|
if (!date('I')) {
|
||||||
$dif -= 3600;
|
// For summer -3600sec.
|
||||||
}
|
$dif -= 3600;
|
||||||
|
}
|
||||||
|
|
||||||
$total_sec = strtotime($tmp->timestamp);
|
$total_sec = strtotime($tmp->timestamp);
|
||||||
$total_sec += $dif;
|
$total_sec += $dif;
|
||||||
$last_contact = date($config['date_format'], $total_sec);
|
$last_contact = date($config['date_format'], $total_sec);
|
||||||
$last_contact_value = ui_print_timestamp($last_contact, true);
|
$last_contact_value = ui_print_timestamp($last_contact, true);
|
||||||
|
} else {
|
||||||
|
$title = date($config['date_format'], strtotime($tmp->timestamp));
|
||||||
|
$value = human_time_comparation(strtotime($tmp->timestamp), 'large');
|
||||||
|
$last_contact_value = '<span title="'.$title.'">'.$value.'</span>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone'];
|
|
||||||
date_default_timezone_set($user_timezone);
|
date_default_timezone_set($user_timezone);
|
||||||
$title = date($config['date_format'], strtotime($tmp->timestamp));
|
$title = date($config['date_format'], strtotime($tmp->timestamp));
|
||||||
$value = human_time_comparation(strtotime($tmp->timestamp), 'large');
|
$value = human_time_comparation(strtotime($tmp->timestamp), 'large');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user