Generate 18-digit LDAP Timestamp from Date and Time
Unit Converter
- {{ unit.name }}
- {{ unit.name }} ({{updateToValue(fromUnit, unit, fromValue)}})
Citation
Use the citation below to add this to your bibliography:
Find More Calculator ☟
Generating 18-digit LDAP timestamps is a critical task for system administrators and IT professionals working with Microsoft Active Directory. These timestamps are used in various attributes such as pwdLastSet, accountExpires, LastLogon, and LastLogonTimestamp. Being able to generate these timestamps from a specified date and time ensures accurate record-keeping and compliance with security policies.
Calculation Formula
The formula to generate an 18-digit LDAP timestamp from a given date and time is as follows:
-
Convert Date to Epoch Time:
- Convert the selected date and time to Unix epoch time (seconds since Jan 1, 1970).
-
Convert to LDAP Epoch: \[ \text{LDAP Epoch} = \text{Unix Epoch Time} + 11,644,473,600 \] (where 11,644,473,600 is the number of seconds between Jan 1, 1601, and Jan 1, 1970).
-
Convert to 100-nanosecond Intervals: \[ \text{LDAP Timestamp} = \text{LDAP Epoch} \times 10,000,000 \]
Example Calculation
For a selected date and time of 2025-02-26 11:07:06
:
-
Convert to Unix Epoch Time: \[ \text{Unix Epoch Time} = \text{Date}(2025, 1, 26, 11, 7, 6).getTime() / 1000 = 1,741,741,626 \]
-
Convert to LDAP Epoch: \[ \text{LDAP Epoch} = 1,741,741,626 + 11,644,473,600 = 13,386,215,226 \]
-
Convert to LDAP Timestamp: \[ \text{LDAP Timestamp} = 13,386,215,226 \times 10,000,000 = 133,862,152,260,000,000 \]
The resulting 18-digit LDAP timestamp is 133862152260000000
.
Importance and Usage Scenarios
Generating 18-digit LDAP timestamps is essential for:
- Active Directory Management: Setting attributes like account expiration and last logon times.
- Auditing and Compliance: Ensuring accurate timestamps for auditing purposes.
- System Security: Enforcing security policies based on specific dates and times.
Common FAQs
-
What is the format of an 18-digit LDAP timestamp?
- It represents the number of 100-nanosecond intervals since January 1, 1601.
-
Why do I need to generate an LDAP timestamp?
- This is necessary for configuring and managing Active Directory attributes such as account expiry and logon times.
-
Can I convert an LDAP timestamp back to a human-readable date?
- Yes, you can use a conversion tool or formula to reverse the process and get the corresponding date and time.
This tool allows you to easily generate 18-digit LDAP timestamps from a selected date and time, ensuring precision and accuracy in your Active Directory management tasks.