Skip to content

Commit e959394

Browse files
committed
Merge branch 'strftime' into 'master'
compat: get rid of deprecated strftime (and fix GetFormattedTime return) See merge request grommunio/grommunio-sync!102
2 parents 325cf53 + 8a1e84f commit e959394

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

grommunio-sync-top.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private function scrOverview() {
311311
"grommunio-sync-top live stats (%s, Gromox %s) %s\n",
312312
$this->getVersion(),
313313
phpversion("mapi"),
314-
@strftime("%x %T")
314+
date("Y-m-d H:i:s")
315315
));
316316
++$lc;
317317

lib/core/devicemanager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ public function AnnounceIgnoredMessage($folderid, $id, SyncObject $message, $rea
10111011
$info .= sprintf(" - From: '%s'", $message->from);
10121012
}
10131013
if (isset($message->starttime)) {
1014-
$info .= sprintf(" - On: '%s'", strftime("%Y-%m-%d %H:%M", $message->starttime));
1014+
$info .= sprintf(" - On: '%s'", date("Y-m-d H:i", $message->starttime));
10151015
}
10161016
$brokenMessage->info = $info;
10171017
$brokenMessage->reasonString = SLog::GetLastMessage(LOGLEVEL_WARN);

lib/utils/utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,10 @@ public static function getDayStartOfTimestamp($timestamp) {
563563
*/
564564
public static function GetFormattedTime($timestamp = false) {
565565
if (!$timestamp) {
566-
return @strftime("%d/%m/%Y %H:%M:%S");
566+
$timestamp = time();
567567
}
568568

569-
return @strftime("%d/%m/%Y %H:%M:%S", $timestamp);
569+
return date("d/m/Y H:i:s", $timestamp);
570570
}
571571

572572
/**

0 commit comments

Comments
 (0)