From 71212aa1fce01638311d47b84a2ad2e4d32ed651 Mon Sep 17 00:00:00 2001 From: Heikki Hokkanen Date: Thu, 1 Jan 2009 10:57:22 +0200 Subject: [PATCH] Use gmstrftime() instead of strftime(). --- inc/functions.php | 10 +++++----- index.php | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index a017a09..268e568 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -67,7 +67,7 @@ function get_project_info($name) $headinfo = git_get_commit_info($name, 'HEAD'); $info['head_stamp'] = $headinfo['author_utcstamp']; - $info['head_datetime'] = strftime($conf['datetime'], $headinfo['author_utcstamp']); + $info['head_datetime'] = gmstrftime($conf['datetime'], $headinfo['author_utcstamp']); $info['head_hash'] = $headinfo['h']; $info['head_tree'] = $headinfo['tree']; @@ -121,9 +121,9 @@ function git_get_commit_info($project, $hash = 'HEAD') elseif (preg_match($pattern, $line, $matches) > 0) { $info[$matches[1] .'_name'] = $matches[2]; $info[$matches[1] .'_mail'] = $matches[3]; - $info[$matches[1] .'_stamp'] = $matches[4]; + $info[$matches[1] .'_stamp'] = $matches[4] + ((intval($matches[5]) / 100.0) * 3600); $info[$matches[1] .'_timezone'] = $matches[5]; - $info[$matches[1] .'_utcstamp'] = $matches[4] - ((intval($matches[5]) / 100.0) * 3600); + $info[$matches[1] .'_utcstamp'] = $matches[4]; if (isset($conf['mail_filter'])) { $info[$matches[1] .'_mail'] = $conf['mail_filter']($info[$matches[1] .'_mail']); @@ -334,7 +334,7 @@ function handle_shortlog($project, $hash = 'HEAD') } $result[] = array( 'author' => $info['author_name'], - 'date' => strftime($conf['datetime'], $info['author_utcstamp']), + 'date' => gmstrftime($conf['datetime'], $info['author_utcstamp']), 'message' => $info['message'], 'commit_id' => $rev, 'tree' => $info['tree'], @@ -362,7 +362,7 @@ function handle_tags($project, $limit = 0) $info = git_get_commit_info($project, $tag['h']); $result[] = array( 'stamp' => $info['author_utcstamp'], - 'date' => strftime($conf['datetime'], $info['author_utcstamp']), + 'date' => gmstrftime($conf['datetime'], $info['author_utcstamp']), 'h' => $tag['h'], 'fullname' => $tag['fullname'], 'name' => $tag['name'], diff --git a/index.php b/index.php index 0b6a7dd..43b97d0 100644 --- a/index.php +++ b/index.php @@ -166,12 +166,12 @@ elseif ($action === 'commit') { $page['author_name'] = $info['author_name']; $page['author_mail'] = $info['author_mail']; - $page['author_datetime'] = strftime($conf['datetime_full'], $info['author_utcstamp']); - $page['author_datetime_local'] = strftime($conf['datetime_full'], $info['author_stamp']) .' '. $info['author_timezone']; + $page['author_datetime'] = gmstrftime($conf['datetime_full'], $info['author_utcstamp']); + $page['author_datetime_local'] = gmstrftime($conf['datetime_full'], $info['author_stamp']) .' '. $info['author_timezone']; $page['committer_name'] = $info['committer_name']; $page['committer_mail'] = $info['committer_mail']; - $page['committer_datetime'] = strftime($conf['datetime_full'], $info['committer_utcstamp']); - $page['committer_datetime_local'] = strftime($conf['datetime_full'], $info['committer_stamp']) .' '. $info['committer_timezone']; + $page['committer_datetime'] = gmstrftime($conf['datetime_full'], $info['committer_utcstamp']); + $page['committer_datetime_local'] = gmstrftime($conf['datetime_full'], $info['committer_stamp']) .' '. $info['committer_timezone']; $page['tree_id'] = $info['tree']; $page['parents'] = $info['parents']; $page['message'] = $info['message']; @@ -201,7 +201,7 @@ elseif ($action === 'commitdiff') { $page['message_full'] = $info['message_full']; $page['author_name'] = $info['author_name']; $page['author_mail'] = $info['author_mail']; - $page['author_datetime'] = strftime($conf['datetime'], $info['author_utcstamp']); + $page['author_datetime'] = gmstrftime($conf['datetime'], $info['author_utcstamp']); $text = git_diff($page['project'], "$hash^", $hash); list($page['files'], $page['diffdata']) = format_diff($text); @@ -290,7 +290,7 @@ elseif ($action === 'search') { $info = git_get_commit_info($page['project'], $c); $shortlog[] = array( 'author' => $info['author_name'], - 'date' => strftime($conf['datetime'], $info['author_utcstamp']), + 'date' => gmstrftime($conf['datetime'], $info['author_utcstamp']), 'message' => $info['message'], 'commit_id' => $info['h'], 'tree' => $info['tree'], @@ -339,7 +339,7 @@ elseif ($action === 'summary') { foreach ($heads as $h) { $info = git_get_commit_info($page['project'], $h['h']); $page['heads'][] = array( - 'date' => strftime($conf['datetime'], $info['author_utcstamp']), + 'date' => gmstrftime($conf['datetime'], $info['author_utcstamp']), 'h' => $h['h'], 'fullname' => $h['fullname'], 'name' => $h['name'], -- 2.11.4.GIT