comparison mgallery.php @ 276:be152168d945

Use DateTime objects instead of UNIX timestamp integers for MG_DATE values.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 15 May 2019 04:13:59 +0300
parents b1d004a6d3f1
children 25324e33fc78
comparison
equal deleted inserted replaced
275:bc7bda1d1410 276:be152168d945
347 347
348 348
349 function mgTimeStr($stamp) 349 function mgTimeStr($stamp)
350 { 350 {
351 global $pageLang, $pageCharset; 351 global $pageLang, $pageCharset;
352 // return date("d M Y (H:i:s)", $stamp);
353 $pageLocale = strtolower($pageLang)."_".strtoupper($pageLang).".".$pageCharset; 352 $pageLocale = strtolower($pageLang)."_".strtoupper($pageLang).".".$pageCharset;
354 setlocale(LC_TIME, $pageLocale); 353 setlocale(LC_TIME, $pageLocale);
355 return strftime("%d %b %Y (%H:%M:%S)", $stamp); 354 return strftime("%d %b %Y (%H:%M:%S)", is_object($stamp) ? $stamp->getTimestamp() : $stamp);
356 } 355 }
357 356
358 357
359 function mgFileSize($size) 358 function mgFileSize($size)
360 { 359 {