Permalink
Browse files

added DateTime.new(Num) wrapper (Num->Int)

  • Loading branch information...
1 parent 7072e95 commit 0d5944786eb732d9248bdc021e2c8167236d254d @FROGGS committed Aug 31, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/core/Temporal.pm
View
@@ -245,6 +245,10 @@ my class DateTime does Dateish {
).in-timezone($timezone);
}
+ multi method new(Num $time, :$timezone=0, :&formatter=&default-formatter) {
+ self.new($time.Int, :$timezone, :&formatter)
+ }
+
multi method new(Int $time is copy, :$timezone=0, :&formatter=&default-formatter) {
# Interpret $time as a POSIX time.
my $second = $time % 60; $time = $time div 60;

0 comments on commit 0d59447

Please sign in to comment.