Convert Current time to millisecond

Convert current time to milliseconds.

Ex. 1719220373569 (5:13 pm in China)

Any idea, how we can achieve this in Appian? Any function or plugins?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Thanks , yes it works.

    I used below code.

      localvariables(
      local!unixEpoch : fn!datetime(1970, 1, 1, 0,0,0,0),
      local!intervalDiff: now() - local!unixEpoch,
      local!stringintervalDiff: fn!tostring(local!intervalDiff),
      local!days: fn!tointeger(local!intervalDiff),
      local!stringPartExcludingDays: fn!split(local!stringintervalDiff, "::")[2],
      local!splitPartExcludingDays: fn!split(local!stringPartExcludingDays, ":"),
      local!hours: fn!tointeger(local!splitPartExcludingDays[1]),
      local!minutes: fn!tointeger(local!splitPartExcludingDays[2]),
      local!seconds: fn!tointeger(local!splitPartExcludingDays[3]),
      local!milliseconds: right(local!splitPartExcludingDays[3], 3),
      fixed(
        (local!days * 24 * 3600) + (local!hours * 3600) + (local!minutes * 60) + local!seconds,
        0,
        true
      ) & local!milliseconds
    )