Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add utility functions for converting Microsoft FILETIMEs to UNIX timestamps #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rc4
Copy link

@rc4 rc4 commented Oct 8, 2021

I've recently been doing a fair amount of work with Active Directory using Net::LDAP, and have found myself needing to convert Microsoft's FILETIME timestamp formats to something more useful in many of my scripts. Microsoft uses this format for a number of attributes, including lastLogon/lastLogonTimeStamp, pwdLastSet, accountExpires, and more.

I figured these made sense to also have alongside the functions for converting between generalizedTimes (which I'm pretty sure AD also uses, for some things...) and UNIX timestamps for anyone else that uses this module to interface with AD.

I've kept the functions pretty simple for now to offer more flexibility, but if you think it would be better for me to be more strict with the input/output validation (or offer more functionality?), I'm willing to add that.

@peternewman
Copy link

@rc4 this looks great.

Could we get it merged please, I've just come looking and digging for the same thing...

Presumably it should have some tests too ideally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants