Give os.date() a try.

https://www.lua.org/pil/22.1.html