From f264250ff423e53d44fee297b5648f437c910d02 Mon Sep 17 00:00:00 2001 From: Fedor Ezeev Date: Thu, 11 Dec 2014 18:06:22 +0000 Subject: Bug 978635: now is interpreted as midnight for searches. r=gerv, a=simon. --- Bugzilla/Search.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 0395d08ee..80de76311 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -2206,11 +2206,15 @@ sub _date_translate { sub SqlifyDate { my ($str) = @_; my $fmt = "%Y-%m-%d %H:%M:%S"; - $str = "" if (!defined $str || lc($str) eq 'now'); + $str = "" if (!defined $str); if ($str eq "") { my ($sec, $min, $hour, $mday, $month, $year, $wday) = localtime(time()); return sprintf("%4d-%02d-%02d 00:00:00", $year+1900, $month+1, $mday); } + if (lc($str) eq 'now') { + my ($sec, $min, $hour, $mday, $month, $year, $wday) = localtime(time()); + return sprintf("%4d-%02d-%02d %02d:%02d:%02d", $year+1900, $month+1, $mday, $hour, $min, $sec); + } if ($str =~ /^(-|\+)?(\d+)([hdwmy])(s?)$/i) { # relative date my ($sign, $amount, $unit, $startof, $date) = ($1, $2, lc $3, lc $4, time); -- cgit v1.2.3-24-g4f1b