From 1950d49f333f9daa1c16a1fbde4fc7d5a975f563 Mon Sep 17 00:00:00 2001 From: "ccooper%deadsquid.com" Date: Sat, 15 Oct 2005 01:09:42 +0000 Subject: [PATCH] - use Date::Manip to set timestamps --- webtools/litmus/process_test.cgi | 4 ++-- webtools/litmus/single_result.cgi | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/webtools/litmus/process_test.cgi b/webtools/litmus/process_test.cgi index bf1f697afdb..f587f656832 100755 --- a/webtools/litmus/process_test.cgi +++ b/webtools/litmus/process_test.cgi @@ -38,7 +38,7 @@ use Litmus::Auth; use Litmus::Utils; use CGI; -use Time::Piece::MySQL; +use Date::Manip; use diagnostics; use Data::Dumper; @@ -130,7 +130,7 @@ foreach my $curtestid (@tests) { my $note = $c->param("testnote_".$curtestid); - my $time = localtime; + my $time = &Date::Manip::UnixDate("now","%q"); # normally, the user comes with a cookie, but for simpletest # users, we just use the web-user@mozilla.org user: diff --git a/webtools/litmus/single_result.cgi b/webtools/litmus/single_result.cgi index 8db411eefa8..eda686ee44a 100755 --- a/webtools/litmus/single_result.cgi +++ b/webtools/litmus/single_result.cgi @@ -36,14 +36,18 @@ use Litmus::Auth; use Litmus::Error; use Litmus::DB::Testresult; use Litmus::DB::Resultbug; + use CGI; +use Date::Manip; my $c = new CGI; print $c->header(); if ($c->param && $c->param('id')) { - my $time = localtime; + my $result = Litmus::DB::Testresult->retrieve($c->param('id')); + + my $time = &Date::Manip::UnixDate("now","%q"); my $cookie = Litmus::Auth::getCookie(); my $user; if ($cookie) { @@ -57,7 +61,7 @@ if ($c->param && $c->param('id')) { if (!Litmus::DB::Resultbug->search(test_result_id =>$c->param('id'), bug_id => $new_bug)) { my $bug = Litmus::DB::Resultbug->create({ - test_result_id => $c->param('id'), + testresult => $result, last_updated => $time, submission_time => $time, user => $user, @@ -71,7 +75,7 @@ if ($c->param && $c->param('id')) { $c->param('new_comment') and $c->param('new_comment') ne '') { my $comment = Litmus::DB::Comment->create({ - test_result_id => $c->param('id'), + testresult => $result, last_updated => $time, submission_time => $time, user => $user, @@ -79,8 +83,6 @@ if ($c->param && $c->param('id')) { }); } } - - my $result = Litmus::DB::Testresult->retrieve($c->param('id')); my $title = 'Test Result #' . $c->param('id') . ' - Details'; my $vars = {