Translated timestamp.php to timestamp.lua.

This commit is contained in:
Johannes Findeisen 2024-03-15 06:28:58 +01:00
commit 1d7173dbcc
2 changed files with 20 additions and 1 deletions

19
timestamp/timestamp.lua Normal file
View file

@ -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)

View file

@ -1,5 +1,5 @@
---
permalink: /cgi/timestamp/
permalink: /cgi/timestamp/obsolete.php
---
<?php