Skip to content

DateTimeToFileTimeUTC Function

Eugene Sergeev edited this page Jan 10, 2016 · 4 revisions

Syntax

int? DateTimeToFileTimeUtc(date:DateTime)

Description

Converts a date in the Windows file time format.

The only known use of this function is to set AD account expiration date/time which is a big integer. Thus, if you get a datetime value, e.g. EmployeeEndDate, you need to convert it to big int to expire an account.

Remarks

If the first input parameter (date) is null, the function returns a null value.

Supported Version

2.15.623.0 and later

Examples

It's very common to have EmployeeEndDate attribute populated with the last working day, not with a termination date. Therefore, you might want to add one extra day to expire an account a day after the end date. The expression below adds one day to employee's end date and converts the result into big int.

DateTimeToFileTimeUTC(DateTimeAdd([//Target/EmployeeEndDate],1))

Mind that if employee's end date contains only date (no time part with HH:mm:ss) then resulting big int value might be a little bit different with the one you set using AD Users and Computers tool because of the time zone, as all the dates are kept in GMT in FIM/MIM Service

Clone this wiki locally