From 1d7173dbcc53321fe82a92d6e25229fdfbaa4a9c Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Fri, 15 Mar 2024 06:28:58 +0100 Subject: [PATCH] Translated timestamp.php to timestamp.lua. --- timestamp/timestamp.lua | 19 +++++++++++++++++++ timestamp/timestamp.php | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 timestamp/timestamp.lua diff --git a/timestamp/timestamp.lua b/timestamp/timestamp.lua new file mode 100644 index 0000000..693f91e --- /dev/null +++ b/timestamp/timestamp.lua @@ -0,0 +1,19 @@ +--- +permalink: /cgi/timestamp/index.lua +--- + +-- Set the timezone (not directly supported in Lua) +-- You'll need to handle timezone conversion manually if needed + +-- Get current time +local timestamp = os.date("%Y.%m.%d-%H:%M:%S") + +-- Get current time in milliseconds +local milliseconds = os.time() * 1000 + +-- Output the HTTP header +io.write("Content-Type: text/plain; charset=utf-8\r\n\r\n") + +-- Output result +io.write(timestamp .. '.' .. milliseconds) + diff --git a/timestamp/timestamp.php b/timestamp/timestamp.php index 42f9ca1..869b4ed 100644 --- a/timestamp/timestamp.php +++ b/timestamp/timestamp.php @@ -1,5 +1,5 @@ --- -permalink: /cgi/timestamp/ +permalink: /cgi/timestamp/obsolete.php ---