aboutsummaryrefslogtreecommitdiff
path: root/sourcehut-builds/date_utils.luau
diff options
context:
space:
mode:
Diffstat (limited to 'sourcehut-builds/date_utils.luau')
-rw-r--r--sourcehut-builds/date_utils.luau16
1 files changed, 16 insertions, 0 deletions
diff --git a/sourcehut-builds/date_utils.luau b/sourcehut-builds/date_utils.luau
new file mode 100644
index 0000000..be47b3a
--- /dev/null
+++ b/sourcehut-builds/date_utils.luau
@@ -0,0 +1,16 @@
+return {
+ parseDate = function(dateString: string): number
+ local pattern = "(%d+)-(%d+)-(%d+)T(%d+):(%d+):(%d+).(%d+)"
+ local runyear, runmonth, runday,
+ runhour, runminute, runseconds = dateString:match(pattern)
+
+ return os.time({
+ year = runyear,
+ month = runmonth,
+ day = runday,
+ hour = runhour,
+ min = runminute,
+ sec = runseconds
+ })
+ end
+}