Просмотр исходного кода

This should fix the timeoffset problem

Morten Brix Pedersen 25 лет назад
Родитель
Сommit
ddd55e6724
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      pisg.pl

+ 3 - 4
pisg.pl

@@ -43,7 +43,7 @@ my $conf = {
     langfile => 'lang.txt',
     prefix => "",
 
-    # Colors
+    # Colors / Layout
 
     bgcolor => "#dedeee",
     bgpic => '',
@@ -69,7 +69,6 @@ my $conf = {
     pic_h_12 => "yellow-h.png",
     pic_h_18 => "red-h.png",
 
-
     # Less important things
 
     minquote => 25,
@@ -216,6 +215,7 @@ sub init_pisg
 
 
     $timestamp = time();
+    $conf->{start} = time();
 
     if ($conf->{timeoffset} =~ /\+(\d+)/) {
         # We must plus some hours to the time
@@ -241,7 +241,6 @@ sub init_pisg
     $normals = "0";
     $time = localtime($timestamp);
     $repeated = 0;
-    $conf->{start} = $timestamp;   # set start time of file parse
 
     print "Using language template: $conf->{lang}\n\n" if ($conf->{lang} ne 'EN');
 
@@ -629,7 +628,7 @@ sub parse_file
 
     close(LOGFILE);
 
-    my ($sec,$min,$hour) = localtime(time - $conf->{start});
+    my ($sec,$min,$hour) = gmtime(time() - $conf->{start});
     $processtime = sprintf("%02d hours, %02d minutes and %02d seconds", $hour,  $min, $sec);
 
     $nicks = scalar keys %line;