about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--META6.json3
-rw-r--r--lib/Taurus/Timestamp.rakumod7
2 files changed, 9 insertions, 1 deletions
diff --git a/META6.json b/META6.json
index 17c97eb..a150fba 100644
--- a/META6.json
+++ b/META6.json
@@ -8,7 +8,8 @@
     "perl" : "6.d",
     "provides" : {
         "Taurus::CLI" : "lib/Taurus/CLI.rakumod",
-        "Taurus::Seconds" : "lib/Taurus/Seconds.rakumod"
+        "Taurus::Seconds" : "lib/Taurus/Seconds.rakumod",
+        "Taurus::Timestamp" : "lib/Taurus/Timestamp.rakumod"
     },
     "depends" : [
         "CSV::Parser",
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;
+}