Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
7a4bbc15
Commit
7a4bbc15
authored
May 21, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 337782: Change the way that whine.pl gets and formats the current date
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave
parent
232d08fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
whine.pl
whine.pl
+7
-10
No files found.
whine.pl
View file @
7a4bbc15
...
...
@@ -111,16 +111,13 @@ if (open(NOMAIL, '<', "$datadir/nomail")) {
}
}
# get the current date and time from the database
$sth
=
$dbh
->
prepare
(
'SELECT '
.
$dbh
->
sql_date_format
(
'NOW()'
,
'%y,%m,%d,%a,%H,%i'
));
$sth
->
execute
;
my
(
$now_year
,
$now_month
,
$now_day
,
$now_weekdayname
,
$now_hour
,
$now_minute
)
=
split
(
','
,
$sth
->
fetchrow_array
);
$sth
->
finish
;
# As DBs have different days numbering, use day name and convert it
# to the range 0-6
my
$now_weekday
=
index
(
"SunMonTueWedThuFriSat"
,
$now_weekdayname
)
/
3
;
# get the current date and time
my
(
$now_sec
,
$now_minute
,
$now_hour
,
$now_day
,
$now_month
,
$now_year
,
$now_weekday
)
=
localtime
;
# Convert year to two digits
$now_year
=
sprintf
(
"%02d"
,
$now_year
%
100
);
# Convert the month to January being "1" instead of January being "0".
$now_month
++
;
my
@daysinmonth
=
qw(0 31 28 31 30 31 30 31 31 30 31 30 31)
;
# Alter February in case of a leap year. This simple way to do it only
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment