am: use gmtime() to parse mercurial patch date
[gitweb.git] / git-am.sh
index 1f4c09e3d434646ebd3b53d1a151a1fb916dffa9..5eec11d5f09c50a83553a8ea5ad763f0d2e44feb 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -343,11 +343,11 @@ split_patches () {
                                elsif (/^\# User /) { s/\# User/From:/ ; print ; }
                                elsif (/^\# Date /) {
                                        my ($hashsign, $str, $time, $tz) = split ;
-                                       $tz = sprintf "%+05d", (0-$tz)/36;
+                                       $tz_str = sprintf "%+05d", (0-$tz)/36;
                                        print "Date: " .
                                              strftime("%a, %d %b %Y %H:%M:%S ",
-                                                      localtime($time))
-                                             . "$tz\n";
+                                                      gmtime($time-$tz))
+                                             . "$tz_str\n";
                                } elsif (/^\# /) { next ; }
                                else {
                                        print "\n", $_ ;