• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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

 
tumbleweed and gunslinger
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Check your pockets for water buffalo. You might need to use this tiny ad until locate a water buffalo:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic