aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-16 00:29:03 +0900
committernsfisis <nsfisis@gmail.com>2026-08-16 01:03:45 +0900
commitaad468e8b75ffc3e87ea6dfa22c53a8299fc08da (patch)
tree8864fec7343dfb91c7c12e35a2989081ad197fd7 /crates/shirabe/src/command
parent2936cb809da433a92f267f3bc232d88ed4e315ac (diff)
downloadphp-shirabe-aad468e8b75ffc3e87ea6dfa22c53a8299fc08da.tar.gz
php-shirabe-aad468e8b75ffc3e87ea6dfa22c53a8299fc08da.tar.zst
php-shirabe-aad468e8b75ffc3e87ea6dfa22c53a8299fc08da.zip
feat(php-shim): render human-facing timestamps in the local timezone
Split date() into date_utc() and date_local(), the latter resolving the system's local timezone through the tzfile crate ($TZ, then /etc/localtime, falling back to UTC when neither is readable). The timestamps Composer renders for humans -- the GitHub OAuth token note, the GitHub API rate limit reset time, the Perforce client spec fields and the "today" check of the show command -- now go through date_local(). PHP resolves its default timezone from the date.timezone ini setting, which Shirabe does not read, so date_default_timezone_get/set have no input left to model and are dropped from the shim and its callers. The resulting difference is recorded in docs/known-incompatibilities.md. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command')
-rw-r--r--crates/shirabe/src/command/show_command.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/shirabe/src/command/show_command.rs b/crates/shirabe/src/command/show_command.rs
index e5d5a1f2..f2246cbe 100644
--- a/crates/shirabe/src/command/show_command.rs
+++ b/crates/shirabe/src/command/show_command.rs
@@ -39,8 +39,8 @@ use indexmap::IndexMap;
use shirabe_pcre::{CaptureKey, Preg};
use shirabe_php_shim::{
CmpOp, DATE_ATOM, InvalidArgumentException, LogicException, PhpMixed, UnexpectedValueException,
- array_search, date, date_format_to_strftime, extension_loaded, impl_php_class, in_array_loose,
- in_array_strict, php_regex, realpath, strtolower, version_compare,
+ array_search, date_format_to_strftime, date_local, extension_loaded, impl_php_class,
+ in_array_loose, in_array_strict, php_regex, realpath, strtolower, version_compare,
};
use shirabe_semver::Semver;
use shirabe_semver::constraint::AnyConstraint;
@@ -1484,7 +1484,7 @@ impl ShowCommand {
if release_date
.format(date_format_to_strftime("Ymd"))
.to_string()
- == date("Ymd", None)
+ == date_local("Ymd", None)
{
return "today".to_string();
}