changeset 245:8ddf84b459d3

Show timestamps in localized form.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 01 May 2018 16:00:40 +0300
parents 73348fa0bc85
children 548a349bc015
files mgallery.php
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mgallery.php	Tue May 01 16:00:22 2018 +0300
+++ b/mgallery.php	Tue May 01 16:00:40 2018 +0300
@@ -351,7 +351,11 @@
 
 function mgTimeStr($stamp)
 {
-  return date("d M Y (H:i:s)", $stamp);
+  global $pageLang, $pageCharset;
+  //  return date("d M Y (H:i:s)", $stamp);
+  $pageLocale = strtolower($pageLang)."_".strtoupper($pageLang).".".$pageCharset;
+  setlocale(LC_TIME, $pageLocale);
+  return strftime("%d %b %Y (%H:%M:%S)", $stamp);
 }