diff options
author | Andinus <andinus@nand.sh> | 2021-08-16 18:12:11 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-08-16 18:12:11 +0530 |
commit | e3d7a57ee338b39d2d871ab8da7a784497d4b47d (patch) | |
tree | d9e374e1e4e4b8b6d604f505f99a99cb5b872db8 /lib/Taurus | |
parent | f7991707b48f6f503e18dbac31b9af80290d9991 (diff) | |
download | taurus-e3d7a57ee338b39d2d871ab8da7a784497d4b47d.tar.gz |
Add timestamp-to-date subroutine, module Timestamp
It returns Date object of given stamp.
Diffstat (limited to 'lib/Taurus')
-rw-r--r-- | lib/Taurus/Timestamp.rakumod | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Taurus/Timestamp.rakumod b/lib/Taurus/Timestamp.rakumod new file mode 100644 index 0000000..e9013bc --- /dev/null +++ b/lib/Taurus/Timestamp.rakumod @@ -0,0 +1,7 @@ +unit module Taurus::Timestamp; + +sub timestamp-to-date(Str $stamp --> Date) is export { + Date.new( + "%s-%s-%s".sprintf(.substr(6, 4), .substr(3, 2), .substr(0, 2)) + ) with $stamp; +} |