| Author |
Why doesn't this work (Date/Time conversion)
|
David Yutzy
tumbleweed and gunslinger
Ranch Hand
Joined: Jun 29, 2001
Posts: 192
|
|
Ok... I'm writing some code that reads attributes from Active Directory and the attribute value returned is thus: this.pwdLastSet = 127560719042795072 What I get back is some jacked up date. Try substituting date.getTime() instead of this.pwdLastSet and it still comes back all crazy. [ March 23, 2005: Message edited by: David Yutzy ]
|
 |
Horatio Westock
Ranch Hand
Joined: Feb 23, 2005
Posts: 221
|
|
Have a look at the Apache POI project, in particular this. There is a method in there: filetimeToDate(int high, int low), which lets you convert between the windows epoch and the unix epoch. If you are doing other stuff with windows datatypes, you will probably find other goodies in the POI project.
|
 |
David Yutzy
tumbleweed and gunslinger
Ranch Hand
Joined: Jun 29, 2001
Posts: 192
|
|
Very useful, but to get what I need, I have to somehow parse the "low" and "high" bits of the 64-bit number returned into 2x32 bit numbers. Any idea how to do this?
|
 |
 |
|
|
subject: Why doesn't this work (Date/Time conversion)
|
|
|