setTimezone($siteZone)->format(self::FORMAT); } /** * Today, on the site's own clock. * * `wp_timezone()` rather than `current_time()`: it returns the zone as an * object, which is the thing {@see self::of()} needs, and it honours both * halves of WordPress's timezone setting — a named zone with its own DST * history, or a bare UTC offset for a site that never set one. */ public static function today(): string { return self::of(new \DateTimeImmutable('now', new \DateTimeZone('UTC')), wp_timezone()); } }