diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index f632a1ea9c7..1d0f0d92c16 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -40,7 +40,7 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'adherent', '', '', 'cotisation'); -$year = strftime("%Y", time()); +$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index bb65a1047a8..e7195d4ee30 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -42,7 +42,7 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'adherent', '', '', 'cotisation'); -$year = strftime("%Y", time()); +$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 11447dcd8bb..30b79f4bd76 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -47,7 +47,7 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'adherent', '', '', 'cotisation'); -$year = strftime("%Y", time()); +$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 9e2e485c92a..db85490e1bb 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -52,7 +52,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 15642da2d39..9052ed7ab27 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -65,7 +65,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 50848654a71..1bf7706bf87 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -62,7 +62,7 @@ if ($userid > 0) { } } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 7bb430489b2..760a0eca4c8 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -64,7 +64,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 28eee624db2..e71a85004d1 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -74,7 +74,7 @@ llxHeader('', $langs->trans("PurchasesJournal"), '', '', 0, 0, '', '', $morequer $form = new Form($db); -$year_current = strftime("%Y", dol_now()); +$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()) - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index d704e09ad68..0fc5a192271 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -77,7 +77,7 @@ $morequery = '&date_startyear='.$date_startyear.'&date_startmonth='.$date_startm llxHeader('', $langs->trans("SellsJournal"), '', '', 0, 0, '', '', $morequery); -$year_current = strftime("%Y", dol_now()); +$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()) - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 7f8e181f121..d5aef47c285 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -39,7 +39,7 @@ $local = GETPOST('localTaxType', 'int'); // Date range $year = GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; } else { $year_current = $year; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index e9aab173337..ad0b86a161d 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -38,7 +38,7 @@ $localTaxType = GETPOST('localTaxType', 'int'); // Date range $year = GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; } else { $year_current = $year; diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 9e03f156848..66c58580df6 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -49,7 +49,7 @@ $local = GETPOST('localTaxType', 'int'); // Date range $year = GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; } else { $year_current = $year; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 15c369b7a52..3f3e14e2d61 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -59,7 +59,7 @@ $nbofyear = 1; // Date range $year = GETPOST('year', 'int'); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $month_current = strftime("%m", dol_now()); $year_start = $year_current - ($nbofyear - 1); } else { diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 8e20f5b0afd..4d65c201ffd 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -371,7 +371,7 @@ print ''; $now_show_delta = 0; $minyear = substr($minyearmonth, 0, 4); $maxyear = substr($maxyearmonth, 0, 4); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $nowyearmonth = strftime("%Y-%m", dol_now()); $maxyearmonth = max($maxyearmonth, $nowyearmonth); $now = dol_now(); diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index 53446163183..88e04e89303 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -310,7 +310,7 @@ print ''; $now_show_delta = 0; $minyear = substr($minyearmonth, 0, 4); $maxyear = substr($maxyearmonth, 0, 4); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $nowyearmonth = strftime("%Y-%m", dol_now()); $maxyearmonth = max($maxyearmonth, $nowyearmonth); $now = dol_now(); diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 4dbdd9f5be8..7d4483de6cf 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -304,7 +304,7 @@ function getDefaultDatesForTransfer() $date_end = dol_get_last_day($year_end, $month_end); } } elseif ($periodbydefaultontransfer == 1) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()); $pastmonthyear = $year_current; if ($pastmonth == 0) { @@ -312,7 +312,7 @@ function getDefaultDatesForTransfer() $pastmonthyear--; } } else { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()) - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 4109c30d335..e9c2b82ae22 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -41,7 +41,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index b4d11320411..e9fdd03a2be 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -54,7 +54,7 @@ if ($user->socid) { } $result = restrictedArea($user, 'expensereport', $id, ''); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index f1ab4b08fec..162afb68077 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -43,7 +43,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/product/stock/fiche-valo.php b/htdocs/product/stock/fiche-valo.php index b4277e559b1..0e3f9367e16 100644 --- a/htdocs/product/stock/fiche-valo.php +++ b/htdocs/product/stock/fiche-valo.php @@ -106,7 +106,7 @@ if ($id > 0) { /* ************************************************************************** */ print "
\n"; - $year = strftime("%Y", time()); + $year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $file = $conf->stock->dir_temp.'/entrepot-'.$entrepot->id.'-'.($year).'.png'; diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 6bf59ebeb0e..af98ee98540 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -52,7 +52,7 @@ if ($page < 0) { $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $offset = $limit * $page; -$year = strftime("%Y", time()); +$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); /* diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index ba293dea744..32498121045 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -41,7 +41,7 @@ if ($user->socid > 0) { $action = ''; $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year', 'int') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index dd807b7bb93..07b0199d480 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -44,7 +44,7 @@ if ($user->socid > 0) { $action = ''; $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index b1f5dbdc7f9..1e26bf5871a 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -36,7 +36,7 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 9ee2e52a226..5ba1b818137 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -459,7 +459,7 @@ if ($id > 0) { // Create if ($action == 'create') { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()) - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 4dfd0c84e0c..ba5d254f22b 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -51,7 +51,7 @@ if ($user->socid) { } $result = restrictedArea($user, 'salaries', '', '', ''); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 52965da8182..7e94af1a431 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -45,7 +45,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index a8a4363ba5c..d7793c3ced1 100755 --- a/scripts/accountancy/export-thirdpartyaccount.php +++ b/scripts/accountancy/export-thirdpartyaccount.php @@ -45,7 +45,7 @@ if (!$user->admin) { // Date range $year = GETPOST("year"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $month_current = strftime("%m", dol_now()); $year_start = $year_current; } else {