[23] > my $now = DateTime.now
2024-09-29T14:59:10.178051+08:00
[24] > my $eight-hours-later = Date.today.DateTime.later(:8hours)
2024-09-29T08:00:00Z
[25] > $now - $eight-hours-later
-3649.82194842
[26] > $now.timezone
28800
[27] > $eight-hours-later.timezone
0
[28] > Date.today.DateTime.timezone
0
[29] > $now.WHAT
(DateTime)
[30] $eight-hours-later.WHAT
(DateTime)
在上面的 REPL 中,$now
和$eight-hours-later
都是DateTime
,但是为什么$now
时区为28800和$eight-hours-later
时区为0,导致时区不同。
我的 Raku 版本是:
Welcome to Rakudo v2024.05.1.
Implementing the Raku Programming Language v6.d.
Built on MoarVM version 2024.05