Skip to content

Commit

Permalink
Datetime.local should default to $*TZ
Browse files Browse the repository at this point in the history
Not the internal logic for default timezone offset, because one could
have a outer lexical $*TZ with different semantics (which is what
testing of App::Football does).
  • Loading branch information
lizmat committed Nov 15, 2020
1 parent 75574be commit 9443fba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/core.c/DateTime.pm6
Expand Up @@ -531,12 +531,8 @@ my class DateTime does Dateish {
}
}

method utc( DateTime:D: --> DateTime:D) {
self.in-timezone(0)
}
method local(DateTime:D: --> DateTime:D) {
self.in-timezone(get-local-timezone-offset)
}
method utc( DateTime:D: --> DateTime:D) { self.in-timezone(0) }
method local(DateTime:D: --> DateTime:D) { self.in-timezone($*TZ) }

proto method Date() {*}
multi method Date(DateTime:D: --> Date:D) { Date.new($!year,$!month,$!day) }
Expand Down

0 comments on commit 9443fba

Please sign in to comment.