GE Lua Documentation

Press F to search!

getDateTimeUTCString

Definition


-- @/lua/ge/ge_utils.lua:1604

function getDateTimeUTCString()
  -- ISO 8601 UTC Date and Time Format Explanation:
  -- "2023-01-01T12:00:00.123Z" is an example of a complete timestamp in this format.
  -- "2023-01-01" is the date (Year-Month-Day).
  -- "T" is a delimiter separating the date and time components.
  -- "12:00:00.123" is the time (Hour:Minute:Second.Milliseconds).
  -- "Z" indicates that this time is in Coordinated Universal Time (UTC).
  local t = socket.gettime()
  return os.date("!%Y-%m-%dT%H:%M:%S", t) .. string.format(".%03dZ", (t * 1000) % 1000)
end

Callers

@/lua/ge/extensions/editor/assetManagementTool.lua
                linkJsonData["hash"] = FS:getHashFileAlgorithmId() .. ":" .. hash
                linkJsonData["time"] = getDateTimeUTCString()
                serializeJsonToFile(linkPath, linkJsonData, true)