From b0ed64e5f19d957102c6e73fc79b06801c1a4ecc Mon Sep 17 00:00:00 2001 From: timriker Date: Fri, 22 Nov 2002 06:57:39 +0000 Subject: [PATCH] gmtime git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@683 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/DynaConfig.pl | 4 ++-- src/Factoids/Core.pl | 2 +- src/IRC/Irc.pl | 2 +- src/IRC/IrcHooks.pl | 4 ++-- src/IRC/Schedulers.pl | 8 ++++---- src/Modules/Factoids.pl | 6 +++--- src/Modules/News.pl | 10 +++++----- src/Modules/Uptime.pl | 2 +- src/UserExtra.pl | 2 +- src/core.pl | 4 ++-- src/logger.pl | 6 +++--- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/DynaConfig.pl b/src/DynaConfig.pl index a3c2609..e5b6eb6 100644 --- a/src/DynaConfig.pl +++ b/src/DynaConfig.pl @@ -134,7 +134,7 @@ sub writeUserFile { return; } - my $time = scalar(localtime); + my $time = scalar(gmtime); print OUT "#v1: blootbot -- $ident -- written $time\n\n"; @@ -311,7 +311,7 @@ sub writeChanFile { return; } - my $time = scalar(localtime); + my $time = scalar(gmtime); print OUT "#v1: blootbot -- $ident -- written $time\n\n"; if ($flag_quit) { diff --git a/src/Factoids/Core.pl b/src/Factoids/Core.pl index e288157..ef6f7d1 100644 --- a/src/Factoids/Core.pl +++ b/src/Factoids/Core.pl @@ -249,7 +249,7 @@ sub FactoidStuff { return; } - &status("forgot (safe delete): '$faqtoid' - ". scalar(localtime)); + &status("forgot (safe delete): '$faqtoid' - ". scalar(gmtime)); ### TODO: check if the "backup" exists and overwrite it my $check = &getFactoid("$faqtoid #DEL#"); diff --git a/src/IRC/Irc.pl b/src/IRC/Irc.pl index b6eb283..cea5b30 100644 --- a/src/IRC/Irc.pl +++ b/src/IRC/Irc.pl @@ -606,7 +606,7 @@ sub nick { if ($bad) { &WARN("Nick: not going to try and get my nick back. [". - scalar(localtime). "]"); + scalar(gmtime). "]"); # hrm... over time we lose track of our own nick. # return; } diff --git a/src/IRC/IrcHooks.pl b/src/IRC/IrcHooks.pl index fbf99ba..34456c6 100644 --- a/src/IRC/IrcHooks.pl +++ b/src/IRC/IrcHooks.pl @@ -955,7 +955,7 @@ sub on_quit { $netsplit{lc $nick} = time(); if (!exists $netsplitservers{$1}{$2}) { - &status("netsplit detected between $1 and $2 at [".scalar(localtime)."]"); + &status("netsplit detected between $1 and $2 at [".scalar(gmtime)."]"); $netsplitservers{$1}{$2} = time(); } } @@ -1058,7 +1058,7 @@ sub on_topicinfo { my $timestr; if (time() - $time > 60*60*24) { - $timestr = "at ". localtime $time; + $timestr = "at ". gmtime $time; } else { $timestr = &Time2String(time() - $time) ." ago"; } diff --git a/src/IRC/Schedulers.pl b/src/IRC/Schedulers.pl index 1de039f..afb9e55 100644 --- a/src/IRC/Schedulers.pl +++ b/src/IRC/Schedulers.pl @@ -172,7 +172,7 @@ sub logLoop { ### check if current size is too large. if ( -s $file{log} > $param{'maxLogSize'}) { - my $date = sprintf("%04d%02d%02d", (localtime)[5,4,3]); + my $date = sprintf("%04d%02d%02d", (gmtime)[5,4,3]); $file{log} = $param{'logfile'} ."-". $date; &status("cycling log file."); @@ -689,7 +689,7 @@ sub ircCheck { delete $cache{connect}; } else { &status("IRCTEST: possible lost in space; checking. ". - scalar(localtime) ); + scalar(gmtime) ); &msg($ident, "TEST"); $cache{connect} = time(); } @@ -803,7 +803,7 @@ sub miscCheck2 { # compress logs that should have been compressed. # todo: use strftime? - my ($day,$month,$year) = (localtime(time()))[3,4,5]; + my ($day,$month,$year) = (gmtime(time()))[3,4,5]; my $date = sprintf("%04d%02d%02d",$year+1900,$month+1,$day); if (!opendir(DIR,"$bot_log_dir")) { @@ -1057,7 +1057,7 @@ sub dccStatus { return if ($_[0] eq "2"); # defer. } - my $time = strftime("%H:%M", localtime(time()) ); + my $time = strftime("%H:%M", gmtime(time()) ); my $c; foreach (keys %channels) { diff --git a/src/Modules/Factoids.pl b/src/Modules/Factoids.pl index 9ca5c54..7b1ac14 100644 --- a/src/Modules/Factoids.pl +++ b/src/Modules/Factoids.pl @@ -52,7 +52,7 @@ sub CmdFactInfo { if ($time) { if (time() - $time > 60*60*24*7) { my $days = int( (time() - $time)/60/60/24 ); - $string .= " at \037". scalar(localtime $time). "\037" . + $string .= " at \037". scalar(gmtime $time). "\037" . " ($days days)"; } else { $string .= " ".&Time2String(time() - $time)." ago"; @@ -69,7 +69,7 @@ sub CmdFactInfo { my $time = $factinfo{'modified_time'}; if ($time) { if (time() - $time > 60*60*24*7) { - $string .= " at \037". scalar(localtime $time). "\037"; + $string .= " at \037". scalar(gmtime $time). "\037"; } else { $string .= " ".&Time2String(time() - $time)." ago "; } @@ -109,7 +109,7 @@ sub CmdFactInfo { my $requested_time = $factinfo{'requested_time'}; if ($requested_time) { if (time() - $requested_time > 60*60*24*7) { - $string .= " at \037". scalar(localtime $requested_time). "\037"; + $string .= " at \037". scalar(gmtime $requested_time). "\037"; } else { $string .= ", ".&Time2String(time() - $requested_time)." ago"; } diff --git a/src/Modules/News.pl b/src/Modules/News.pl index 1c1629d..3df9f42 100644 --- a/src/Modules/News.pl +++ b/src/Modules/News.pl @@ -287,11 +287,11 @@ sub add { my $agestr = &::Time2String($::news{$chan}{$str}{Expire} - time() ); my $item = &newsS2N($str); - &::notice($who, "Added '\037$str\037' at [".localtime(time). + &::notice($who, "Added '\037$str\037' at [".gmtime(time). "] by \002$::who\002 for item #\002$item\002."); &::notice($who, "Now do 'news text $item '"); &::notice($who, "This item will expire at \002". - localtime($::news{$chan}{$str}{Expire})."\002 [$agestr from now] " + gmtime($::news{$chan}{$str}{Expire})."\002 [$agestr from now] " ); &writeNews(); @@ -470,7 +470,7 @@ sub read { return; } - my $t = localtime( $::news{$chan}{$item}{Time} ); + my $t = gmtime( $::news{$chan}{$item}{Time} ); my $a = $::news{$chan}{$item}{Author}; my $text = $::news{$chan}{$item}{Text}; my $num = &newsS2N($item); @@ -492,7 +492,7 @@ sub read { my $e; if ($_) { $e = sprintf("\037%s\037 [%s from now]", - scalar(localtime($_)), + scalar(gmtime($_)), &::Time2String($_ - time()) ); } @@ -680,7 +680,7 @@ sub set { return; } else { &::notice($who, "Set expire for \002$item\002, to ". - localtime($time) ." [".&::Time2String($time - time())."]" ); + gmtime($time) ." [".&::Time2String($time - time())."]" ); if (time() > $time) { &::DEBUG("news: hrm... time() > $time, should expire."); diff --git a/src/Modules/Uptime.pl b/src/Modules/Uptime.pl index d433952..983cc0c 100644 --- a/src/Modules/Uptime.pl +++ b/src/Modules/Uptime.pl @@ -17,7 +17,7 @@ sub uptimeStr { my $uptimenow = &uptimeNow(); if (defined $_[0]) { - return "$uptimenow.$$ running $bot_version, ended ". localtime(time()); + return "$uptimenow.$$ running $bot_version, ended ". gmtime(time()); } else { return "$uptimenow running $bot_version"; } diff --git a/src/UserExtra.pl b/src/UserExtra.pl index 50f00e6..2413408 100644 --- a/src/UserExtra.pl +++ b/src/UserExtra.pl @@ -790,7 +790,7 @@ sub userCommands { # status. if ($message =~ /^statu?s$/i) { - my $startString = scalar(localtime $^T); + my $startString = scalar(gmtime $^T); my $upString = &Time2String(time() - $^T); my $count = &countKeys("factoids"); diff --git a/src/core.pl b/src/core.pl index 9cf0c80..e3118e9 100644 --- a/src/core.pl +++ b/src/core.pl @@ -72,7 +72,7 @@ $notcount = 0; ### if ( -d "CVS" ) { use POSIX qw(strftime); - $bot_release = strftime("cvs (%Y%m%d)", localtime( (stat("CVS"))[9] ) ); + $bot_release = strftime("cvs (%Y%m%d)", gmtime( (stat("CVS"))[9] ) ); } else { $bot_release = "1.0.10 (2001xxxx)"; } @@ -515,7 +515,7 @@ sub restart { my $delta = time() - $msgtime; &DEBUG("restart: dtime = $delta"); if (!$conn->connected or time() - $msgtime > 900) { - &status("reconnecting because of uncaught disconnect \@ ".scalar(localtime) ); + &status("reconnecting because of uncaught disconnect \@ ".scalar(gmtime) ); ### $irc->start; &clearIRCVars(); $conn->connect(); diff --git a/src/logger.pl b/src/logger.pl index f262884..bcf7673 100644 --- a/src/logger.pl +++ b/src/logger.pl @@ -91,7 +91,7 @@ sub openLog { } if (&IsParam("logType") and $param{'logType'} =~ /DAILY/i) { - my ($day,$month,$year) = (localtime time())[3,4,5]; + my ($day,$month,$year) = (gmtime time())[3,4,5]; $logDate = sprintf("%04d%02d%02d",$year+1900,$month+1,$day); $file{log} .= "-".$logDate; } @@ -354,9 +354,9 @@ sub status { my $date; if (&IsParam("logType") and $param{'logType'} =~ /DAILY/i) { - $date = sprintf("%02d:%02d.%02d", (localtime $time)[2,1,0]); + $date = sprintf("%02d:%02d.%02d", (gmtime $time)[2,1,0]); - my ($day,$month,$year) = (localtime $time)[3,4,5]; + my ($day,$month,$year) = (gmtime $time)[3,4,5]; my $newlogDate = sprintf("%04d%02d%02d",$year+1900,$month+1,$day); if (defined $logDate and $newlogDate != $logDate) { &closeLog(); -- 2.39.2