-
Notifications
You must be signed in to change notification settings - Fork 0
Fix date display and timezone consistency for workflow stats updates #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Change logic to check if data was fetched TODAY by comparing stored date with today's date - Previously: showed today's date for all platforms with mode='automatic' even if using cached data - Now: only shows today's date if the stored date matches today (was freshly fetched) - Cached/manual platforms correctly show their stored dates Co-authored-by: MishkatIT <125080003+MishkatIT@users.noreply.github.com>
- Use BDT timezone (UTC+6) consistently across all scripts - Fix random delay in workflow: was RANDOM % 1 (always 0), now RANDOM % 420 (0-7 minutes) - Ensures date consistency when running locally or in GitHub Actions - All date operations now use BDT timezone as intended Co-authored-by: MishkatIT <125080003+MishkatIT@users.noreply.github.com>
|
@copilot is it updating things for example count, date while updating manually? |
Yes! When you run
The changes in commits f2b7f17 and eeb57fd ensure the date is always in BDT timezone, regardless of where you run the script (Bangladesh, US, Europe, etc.). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request fixes date display and timezone handling inconsistencies in the workflow statistics update system. The changes ensure that cached data displays its original fetch date rather than today's date, and all datetime operations use the BDT timezone (UTC+6) for consistency.
Changes:
- Implemented timezone-aware datetime operations using BDT (UTC+6) across all Python scripts to ensure consistent dates regardless of execution location
- Refactored date display logic to compare stored dates with today's date instead of relying on the 'automatic' mode flag
- Fixed workflow random delay bug that was always 0 seconds instead of randomizing between 0-7 minutes
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| update_stats.py | Added timezone-aware date recording using BDT (UTC+6) when updating last known counts |
| update_readme.py | Refactored date display logic to check if stored date matches today instead of checking mode; moved raw_date lookup earlier to avoid duplication |
| manual_update.py | Added timezone-aware datetime operations for both date recording and display output |
| .github/workflows/update-stats.yml | Fixed random delay calculation from RANDOM % 1 (always 0) to RANDOM % 420 (0-419 seconds, ~0-7 minutes) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The workflow incorrectly showed today's date for all automatic platforms, even when using cached data from previous fetches. Additionally, timezone handling was inconsistent across scripts, causing different dates depending on execution location.
Changes
Date display logic (
update_readme.py)Timezone standardization (
update_stats.py,manual_update.py,update_readme.py)Workflow randomization (
.github/workflows/update-stats.yml)RANDOM % 1→RANDOM % 420(was always 0, now 0-7 minutes)Result
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
atcoder.jp/usr/bin/python3 python3 update_stats.py(dns block)codeforces.com/usr/bin/python3 python3 update_stats.py(dns block)cses.fi/usr/bin/python3 python3 update_stats.py(dns block)kenkoooo.com/usr/bin/python3 python3 update_stats.py(dns block)leetcode.com/usr/bin/python3 python3 update_stats.py(dns block)lightoj.com/usr/bin/python3 python3 update_stats.py(dns block)toph.co/usr/bin/python3 python3 update_stats.py(dns block)uhunt.onlinejudge.org/usr/bin/python3 python3 update_stats.py(dns block)vjudge.net/usr/bin/python3 python3 update_stats.py(dns block)www.codechef.com/usr/bin/python3 python3 update_stats.py(dns block)www.hackerearth.com/usr/bin/python3 python3 update_stats.py(dns block)www.hackerrank.com/usr/bin/python3 python3 update_stats.py(dns block)www.spoj.com/usr/bin/python3 python3 update_stats.py(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.