How would I convert zulu timestamp to Unix seconds?

I am attempting to get the amount of seconds passed since a group shout using the Group API, but I’m unsure how I would format the resulting shout updated property into a seconds since epoch: “2022-07-22T15:27:53.533Z”. Any help is much appreciated, thanks!

Use DateTime.fromIsoDate:

local date = "2022-07-22T15:27:53.533Z"
local dateTime = DateTime.fromIsoDate(date)
local secondsPassed = os.time() - dateTime.UnixTimestamp -- Access the amount of seconds passed since the group shout using the 'UnixTimestamp' property
1 Like

You’re amazing. Hadn’t encountered DateTime yet, thanks!