pub unsafe static kODPolicyAttributeCurrentTime: Option<&'static ODPolicyAttributeType>CFOpenDirectoryConstants only.Expand description
Policy attribute for the current date and time in seconds.
Policy attribute for the current date and time in seconds since the Unix epoch. Used in policy strings to compare the current time against other times. Suitable for use in policies where “date arithmetic” is needed (i.e. adding/subtracting values to/from the current time or another time in seconds). Ensure all times and date arithmetic in the policy are specified in seconds.
Note that kODPolicyAttributeExpiresEveryNDays needs to be converted to seconds to match the units of the other times. The special keyword DAYS_TO_SECONDS can be used to accomplish this.
In the policy below, password changes are required every 90 days (kODPolicyAttributeExpiresEveryNDays = 90).
[NSString stringWithFormat: “ % @ < % @
- (% @
- DAYS_TO_SECONDS)“, kODPolicyAttributeCurrentTime, kODPolicyAttributeLastPasswordChangeTime, kODPolicyAttributeExpiresEveryNDays];
See also Apple’s documentation