diff --git a/activity_hub.php b/activity_hub.php
index fd857bafd..47e4c14f7 100644
--- a/activity_hub.php
+++ b/activity_hub.php
@@ -60,7 +60,7 @@
// Get the project transitions for the number of projects completed today
// set the timestamp representing the start of today
-$t_start_of_today = mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'));
+$t_start_of_today = mktime(0, 0, 0, idate('m'), idate('d'), idate('y'));
// For transition events (event_type = 'transition'), details2 gives
// the project's new state.
diff --git a/pinc/graph_data.inc b/pinc/graph_data.inc
index c031456de..24a64040a 100644
--- a/pinc/graph_data.inc
+++ b/pinc/graph_data.inc
@@ -372,8 +372,8 @@ function curr_month_proj(string $which): array
$todaysTimeStamp = time();
- $year = (int) date("Y", $todaysTimeStamp);
- $month = (int) date("m", $todaysTimeStamp);
+ $year = idate("Y", $todaysTimeStamp);
+ $month = idate("m", $todaysTimeStamp);
$monthVar = _(date("F", $todaysTimeStamp));
$timeframe = "$monthVar $year";
diff --git a/pinc/theme.inc b/pinc/theme.inc
index 230eda8f9..70e5334c9 100644
--- a/pinc/theme.inc
+++ b/pinc/theme.inc
@@ -964,8 +964,8 @@ function show_completed_projects(bool $terse = false): void
echo "
\n";
$num_months = 12;
}
- $thismonth = (int)date("n");
- $thisyear = (int)date("Y");
+ $thismonth = idate("n");
+ $thisyear = idate("Y");
for ($months_ago = 0; $months_ago <= $num_months; $months_ago++) {
// midnight that begins the 1st day of this month and the next:
$begindate = mktime(0, 0, 0, $thismonth - $months_ago, 1, $thisyear);
@@ -1111,14 +1111,14 @@ function calculate_progress_bar_properties(int $actual, int $goal, bool|string $
// Calculate the progress bar color scaling based on the time of day.
if ($prorate_goal_for_color == 'bar' || $prorate_goal_for_color === true) {
- $t_start_of_today = mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'));
+ $t_start_of_today = mktime(0, 0, 0, idate('m'), idate('d'), idate('y'));
$fraction_of_time_passed = (time() - $t_start_of_today) / (60 * 60 * 24);
// Note: Calculation assumes a 24-hour day which is true except
// possibly for the first and last days of daylight saving time
// depending on how PHP calculates DST in the mktime() call.
} elseif ($prorate_goal_for_color == 'month') {
- $t_start_of_month = mktime(0, 0, 0, (int)date('m'), 1, (int)date('y'));
- $fraction_of_time_passed = (time() - $t_start_of_month) / (60 * 60 * 24 * date("t"));
+ $t_start_of_month = mktime(0, 0, 0, idate('m'), 1, idate('y'));
+ $fraction_of_time_passed = (time() - $t_start_of_month) / (60 * 60 * 24 * idate("t"));
} else {
$fraction_of_time_passed = 1;
}
diff --git a/stats/pp_stage_goal.php b/stats/pp_stage_goal.php
index fe8c92045..13e22c0a9 100644
--- a/stats/pp_stage_goal.php
+++ b/stats/pp_stage_goal.php
@@ -36,7 +36,7 @@ function _get_pages_posted_data(int $start_timestamp): int
}
// Get the total pages for projects that have posted in current month
-$start_timestamp = mktime(0, 0, 0, (int)date('m'), 1, (int)date('Y'));
+$start_timestamp = mktime(0, 0, 0, idate('m'), 1, idate('Y'));
// cache pages posted data for 1 hour
$pp_pages_total = memoize_function("_get_pages_posted_data", [$start_timestamp], 60 * 60);