• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why doesn't this work (Date/Time conversion)  RSS feed

 
David Yutzy
tumbleweed and gunslinger
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!