Skip to content

Commit

Permalink
fix dol_getdate() when timestamp is an empty string (#31714)
Browse files Browse the repository at this point in the history
  • Loading branch information
uvaldenaire-opendsi authored Nov 6, 2024
1 parent b8286ab commit bbf83c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2980,6 +2980,10 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
*/
function dol_getdate($timestamp, $fast = false, $forcetimezone = '')
{
if ($timestamp === '') {
return array();
}

$datetimeobj = new DateTime();
$datetimeobj->setTimestamp($timestamp); // Use local PHP server timezone
if ($forcetimezone) {
Expand Down

0 comments on commit bbf83c7

Please sign in to comment.