Aegis ‘Depot’ Activity – Convert Unix Timestamps to W32Time / FileTimeformat and back

Aegis ‘Depot’ Activity – Convert Unix Timestamps to W32Time / FileTimeformat and back

If you've been following my series on identifying Active Directory accounts whose passwords are going to expire in the next X days, you'll have seen that in order to create an LDAP filter for the date range, that the timestamp has to be in FileTime format which isn't the most readily available format.  So far I have used Powershell scripts to perform the conversion from UnixTime stamp, which most of us understand and is readily available in Aegis, to FileTime.  This works well and is pretty simple.  However after a few times putting the same script in various parts of different workflows I generally decide to replace the script with a dedicated activity, which has the standard inputs and outputs of other activities which makes it a little easier again.

This activity then allows you to convert from UnixTimestamp to FileTime and vice versa, removing the necessity to have any script involved.

The activity looks like this:


It takes a numeric timestamp and input and outputs the desired format based on the radio button selection at output.  Obviously trying to convert an actual Unix Timestamp to a Unix Timestamp will cause some odd results!

At run-time:


Neat and simple!


Activity Installation Instructions are here:
Labels (1)


Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Unixtime is a 32 bit integer with seconds since 1970. (Signed ends when you hit 2 billion seconds in 2036 or so, unsigned runs out of 4 billion seconds in 2108 or so).

W32/Filetime is a 64 bit integer counting 100 nanosecond intervals since 1601. Runs out in the 2500's or so I think. Very far away.
Top Contributors
Version history
Revision #:
8 of 8
Last update:
‎2020-01-09 16:44
Updated by:
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.