Decode This Into Readable Time?

So, I was working with Trello’s API and Due Dates. I then found out that the Due Date is in a weird format.

Is there anyways I can convert it to readable time?

It’s currently in ISO 8601 date format, I don’t believe that Roblox has any built-in way to convert it.
But there’s a script that I found that converts ISO 8601 to the same format as os.date()

3 Likes

Is there anyways to decode a timestamp though?

local s = "2020-07-07T06:10:00.000Z"

function date(str)
  local data = {}
  local y,m,d,h,i,s,t=str:match"(%d+)-(%d+)-(%d+)T(%d+):(%d+):(%d+).(%d+)Z"
  data.year=y data.month=m data.day=d data.hour=h data.min=i data.sec=s data.milli=t
  data.sinceEpoch=os.time(data)
  return data
end

print(date(s).month)
print(date(s).sinceEpoch)
3 Likes