Skip to content

Commit d7519ba

Browse files
committed
Replace deprecated strftime usage with date
1 parent e9c69ba commit d7519ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: core/model/modx/modx.class.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,7 @@ public function logManagerAction($action, $class_key, $item, $userId = null) {
19661966

19671967
$ml = $this->newObject('modManagerLog');
19681968
$ml->set('user', (integer) $userId);
1969-
$ml->set('occurred', strftime('%Y-%m-%d %H:%M:%S'));
1969+
$ml->set('occurred', date('Y-m-d H:i:s'));
19701970
$ml->set('action', empty($action) ? 'unknown' : $action);
19711971
$ml->set('classKey', empty($class_key) ? '' : $class_key);
19721972
$ml->set('item', empty($item) ? 'unknown' : $item);
@@ -2714,7 +2714,7 @@ protected function _log($level, $msg, $target= '', $def= '', $file= '', $line= '
27142714
if ($targetObj == 'FILE' && $cacheManager= $this->getCacheManager()) {
27152715
$filename = isset($targetOptions['filename']) ? $targetOptions['filename'] : 'error.log';
27162716
$filepath = isset($targetOptions['filepath']) ? $targetOptions['filepath'] : $this->getCachePath() . xPDOCacheManager::LOG_DIR;
2717-
$cacheManager->writeFile($filepath . $filename, '[' . strftime('%Y-%m-%d %H:%M:%S') . '] (' . $this->_getLogLevel($level) . $def . $file . $line . ') ' . $msg . "\n" . ($this->getDebug() === true ? '<pre>' . "\n" . print_r(debug_backtrace(), true) . "\n" . '</pre>' : ''), 'a');
2717+
$cacheManager->writeFile($filepath . $filename, '[' . date('Y-m-d H:i:s') . '] (' . $this->_getLogLevel($level) . $def . $file . $line . ') ' . $msg . "\n" . ($this->getDebug() === true ? '<pre>' . "\n" . print_r(debug_backtrace(), true) . "\n" . '</pre>' : ''), 'a');
27182718
}
27192719
$this->sendError('fatal');
27202720
}
@@ -2734,7 +2734,7 @@ protected function _log($level, $msg, $target= '', $def= '', $file= '', $line= '
27342734
* @param string $line The line number of the file that the message occurs for
27352735
*/
27362736
protected function _logInRegister($register, $level, $msg, $def, $file, $line) {
2737-
$timestamp = strftime('%Y-%m-%d %H:%M:%S');
2737+
$timestamp = date('Y-m-d H:i:s');
27382738
$messageKey = (string) time();
27392739
$messageKey .= '-' . sprintf("%06d", $this->_logSequence);
27402740
$message = array(

0 commit comments

Comments
 (0)