From aad468e8b75ffc3e87ea6dfa22c53a8299fc08da Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 16 Aug 2026 00:29:03 +0900 Subject: 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) --- crates/shirabe/tests/command/show_command_test.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/tests/command/show_command_test.rs') diff --git a/crates/shirabe/tests/command/show_command_test.rs b/crates/shirabe/tests/command/show_command_test.rs index 47eae462..20dbf848 100644 --- a/crates/shirabe/tests/command/show_command_test.rs +++ b/crates/shirabe/tests/command/show_command_test.rs @@ -8,7 +8,7 @@ use serial_test::serial; use shirabe::package::Link; use shirabe::package::handle::PackageInterfaceHandle; use shirabe::repository::PlatformRepository; -use shirabe_php_shim::PhpMixed; +use shirabe_php_shim::{PhpMixed, date_local}; /// Build a `Vec<(PhpMixed, PhpMixed)>` command input from `(key, value)` pairs. fn input(pairs: Vec<(&str, PhpMixed)>) -> Vec<(PhpMixed, PhpMixed)> { @@ -1028,7 +1028,7 @@ fn test_self_and_package_combination() { match and prints \"this week\" whenever the local date differs from the UTC date \ (e.g. daily 00:00-09:00 JST); see TODO(php-semantics) in shirabe-php-shim datetime.rs"] fn test_self() { - let today = chrono::Local::now().format("%Y-%m-%d").to_string(); + let today = date_local("Y-m-d", None); let _tear_down = init_temp_composer( Some(&serde_json::json!({ "name": "vendor/package", -- cgit v1.3.1-4-g156e