Leave it to Microsoft to come up with something this convoluted:
spx
This seems to work:
require 'date'
last_logon = 128002727440808261
base = Date.new(1601, 1, 1)
base += last_logon / (60 * 10000000 * 1440)
p base.to_s # "2006-08-17"
Regards,
Dan
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
···
-----Original Message-----
From: Mikkel Bruun [mailto:devlists-ruby-talk@devlists.com]
Sent: Thursday, August 17, 2006 11:43 AM
To: ruby-talk ML
Subject: Microsoft Timestamp (Active Directory)
Active Directory users contain an attribute called
lastlogontimestamp...
its in this format:
128002727440808261
How do I convert this to something more....nice???
On Friday, August 18, 2006, at 3:03 AM, Berger, Daniel wrote:
-----Original Message-----
From: Mikkel Bruun [mailto:devlists-ruby-talk@devlists.com]
Sent: Thursday, August 17, 2006 11:43 AM
To: ruby-talk ML
Subject: Microsoft Timestamp (Active Directory)
Active Directory users contain an attribute called
lastlogontimestamp...
its in this format:
128002727440808261
How do I convert this to something more....nice???
Leave it to Microsoft to come up with something this convoluted:
base = Date.new(1601, 1, 1)
base += last_logon / (60 * 10000000 * 1440)
p base.to_s # "2006-08-17"
Regards,
Dan
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
Mikkel Bruun
www.strongside.dk - Football Portal(DK)
ting.minline.dk - Buy Old Stuff!(DK)
Leave it to Microsoft to come up with something this convoluted:
What could possibly be *less* convoluted than keeping time as a
high resolution (in this case, 100ns) integer since some epoch?
It's actually the *perfect* way to handle time, and I thought
that (and implemented it) long before I knew MS had done it.
Leave it to Microsoft to come up with something this convoluted:
At least their time 0 is close to the beginning of a century, the
beginning of a year, and the beginning of the week. (if you begin
weeks on a Monday) They could have chosen to fill their 64-bit time
value with 100ns offsets from 00:00 17-NOV-1858, which isn't even at
the beginning of anybody's week. (It's a Wednesday)
Microsoft even seems to have gone with a pre-existing external
standard in this case.
Check the NTP protocol. This sounds like the format used by NTP servers.
···
On 8/18/06, Clifford Heath <no@spam.please.net> wrote:
Berger, Daniel wrote:
> Leave it to Microsoft to come up with something this convoluted:
What could possibly be *less* convoluted than keeping time as a
high resolution (in this case, 100ns) integer since some epoch?
It's actually the *perfect* way to handle time, and I thought
that (and implemented it) long before I knew MS had done it.
Mikkel
On Friday, August 18, 2006, at 3:03 AM, Berger, Daniel wrote:
-----Original Message-----
From: Mikkel Bruun [mailto:devlists-ruby-talk@devlists.com]
Sent: Thursday, August 17, 2006 11:43 AM
To: ruby-talk ML
Subject: Microsoft Timestamp (Active Directory)
Active Directory users contain an attribute called
lastlogontimestamp...
its in this format:
128002727440808261
How do I convert this to something more....nice???
Leave it to Microsoft to come up with something this convoluted:
base = Date.new(1601, 1, 1)
base += last_logon / (60 * 10000000 * 1440)
p base.to_s # "2006-08-17"
Regards,
Dan
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
Mikkel Bruun
www.strongside.dk - Football Portal(DK)
ting.minline.dk - Buy Old Stuff!(DK)
Mikkel
On Friday, August 18, 2006, at 3:03 AM, Berger, Daniel wrote:
-----Original Message-----
From: Mikkel Bruun [mailto:devlists-ruby-talk@devlists.com]
Sent: Thursday, August 17, 2006 11:43 AM
To: ruby-talk ML
Subject: Microsoft Timestamp (Active Directory)
Active Directory users contain an attribute called
lastlogontimestamp...
its in this format:
128002727440808261
How do I convert this to something more....nice???
Leave it to Microsoft to come up with something this convoluted:
base = Date.new(1601, 1, 1)
base += last_logon / (60 * 10000000 * 1440)
p base.to_s # "2006-08-17"
Regards,
Dan
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
Mikkel Bruun
www.strongside.dk - Football Portal(DK)
ting.minline.dk - Buy Old Stuff!(DK)
base = DateTime.new(1601,1,1,0,0,0)
base += intLogonFloat
p base
p base.to_s # "2006-08-17T12:37:10Z"
Charles Leeds wrote:
>
> How did you get the lastlogontimestamp attribute into integer format?
>
> Retrieving myuser.lastLogonTimestamp always gives me:
>
> #<WIN32OLE:0x6e39ee0>
>
> Which I have no idea how to deal with.
>
> Thanks,
>
> Charles Leeds
>
> Mikkel Bruun wrote:
>> Amazing...
>>
>> Thanks a bunch
>>
>> Mikkel
>> On Friday, August 18, 2006, at 3:03 AM, Berger, Daniel wrote:
>>
>>>> -----Original Message-----
>>>> From: Mikkel Bruun [mailto:devlists-ruby-talk@devlists.com]
>>>> Sent: Thursday, August 17, 2006 11:43 AM
>>>> To: ruby-talk ML
>>>> Subject: Microsoft Timestamp (Active Directory)
>>>>
>>>>
>>>> Active Directory users contain an attribute called
>>>> lastlogontimestamp...
>>>>
>>>> its in this format:
>>>> 128002727440808261
>>>>
>>>> How do I convert this to something more....nice???
>>>>
>>> Leave it to Microsoft to come up with something this convoluted:
>>>
>>> Microsoft Learn: Build skills that open doors in your career
>>>
>>> spx
>>>
>>> This seems to work:
>>>
>>> require 'date'
>>>
>>> last_logon = 128002727440808261
>>>
>>> base = Date.new(1601, 1, 1)
>>> base += last_logon / (60 * 10000000 * 1440)
>>>
>>> p base.to_s # "2006-08-17"
>>>
>>> Regards,
>>>
>>> Dan
>>>
>>>
>>> This communication is the property of Qwest and may contain
>>> confidential or
>>> privileged information. Unauthorized use of this communication is
>>> strictly
>>> prohibited and may be unlawful. If you have received this
>>> communication
>>> in error, please immediately notify the sender by reply e-mail and
>>> destroy
>>> all copies of the communication and any attachments.
>>>
>>>
>>
>>
>> Mikkel Bruun
>>
>> www.strongside.dk - Football Portal(DK)
>> ting.minline.dk - Buy Old Stuff!(DK)
>>
>>
>>
>>
>
>
>
>
>