0

I want to be able to generate an ActiveDirectory LDAP timestamp in Unix for some tests I need to run. Active Directory stores date/time values as the number of 100-nanosecond intervals that have elapsed since the 0 hour on January 1, 1601 until the date/time that is being stored.

How can I do I get the current time in this format?

1 Answer 1

3

In the terminal:

echo $((($(date +%s) + 11644473600) * 10000000))

Detailed explanation:

  • date +%s gets the current time in seconds since 1970.
  • 11644473600 seconds elapsed from 1601 to 1970.
  • 10000000 is the conversion from seconds to 100-nanoseconds.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.