diff options
Diffstat (limited to 'crates/shirabe-php-shim/src/datetime.rs')
| -rw-r--r-- | crates/shirabe-php-shim/src/datetime.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/shirabe-php-shim/src/datetime.rs b/crates/shirabe-php-shim/src/datetime.rs index 8d1062c1..6bab4afb 100644 --- a/crates/shirabe-php-shim/src/datetime.rs +++ b/crates/shirabe-php-shim/src/datetime.rs @@ -142,8 +142,11 @@ pub fn date_default_timezone_set(tz: &str) -> bool { pub fn date(format: &str, timestamp: Option<i64>) -> String { let timestamp = timestamp.unwrap_or_else(time); - // PHP `date()` renders in the default timezone. Without a timezone database only "UTC" can be - // resolved; any named zone is rejected loudly rather than silently rendered in the wrong zone. + // TODO(phase-c): model the system default timezone. PHP `date()` renders in the default + // timezone (usually the system's local zone); without a timezone database only "UTC" can be + // resolved here, so on a non-UTC machine this diverges whenever the local date differs from + // the UTC date (e.g. daily 00:00-09:00 JST). Fixing this needs a timezone database (a new + // crate). Any named zone is rejected loudly rather than silently rendered in the wrong zone. let tz = date_default_timezone_get(); if tz != "UTC" { panic!( |
