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:
https://www.netiq.com/communities/cool-solutions/how-to-install-a-custom-depot-aegis-activity-from-netiq-cool-too
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:
https://www.netiq.com/communities/cool-solutions/how-to-install-a-custom-depot-aegis-activity-from-netiq-cool-too
DISCLAIMER:
Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Comments
2016-02-16
19:21
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-02-16
19:21
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.
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.