Skip to content

Instantly share code, notes, and snippets.

@amitu

amitu/ldap2unix.go

Last active Aug 29, 2015
Embed
What would you like to do?
LDAP timestamp to Unix Epoch
package main
import (
"fmt"
"os"
"time"
)
func main() {
if len(os.Args) != 2 {
fmt.Println("Usage: ldap2unix <date>")
os.Exit(2)
}
t, err := time.Parse("20060102150405Z", os.Args[1])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Println(t.Unix())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.