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
Hello
This would be epoch time conversion. Below is a calculation which would work perfectly given your timezone is set to HKT.
tointeger( ( todatetime(ri!dateTime) - todatetime("01/01/1970") ) * 24 * 60 * 60 )
Thanks Konduru Chaitanya , 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 )
There is a plugin providing that function.
Date and Time Utilities