Skip to main content

FROMFILETIME

Returns file time as a DateTime value.

Syntax

string FROMFILETIME(long)

Example

This function can be used to return the pwdLastSet value from AD to convert it from Int64 to DateTime. As this is a nullable int64 you will need to get the value as below:

FROMFILETIME(pwdLastSet.Value)

If you are getting errors due to 0 values then you can combine this expression with an if statement to convert 0 to Null.

IF(EQUALS(pwdLastSet, 0), NULL(), FROMFILETIME(pwdLastSet.Value))