From: Brian Candler Date: 2010-08-10T22:36:43+09:00 Subject: Re: Error: Bignum too big to convert into `long' Brian Candler wrote: > Time.at expects number of seconds since Jan 1, 1970. > > The value you have given it is some time in the year 30,828 :-) > > I suspect either your epoch or your multiplier is wrong. Actually, I think you're just reading a dummy value. Note the following: irb(main):001:0> 9223372036854775807.to_s(16) => "7fffffffffffffff" (i.e. the largest possible signed 64-bit value) A quick Google suggests the Microsoft epoch is Jan 1, 1601, and Windows uses 100-nanosecond ticks. Using a 64-bit machine: irb(main):002:0> require 'time' => true irb(main):003:0> Time.parse("Jan 1 1601") => Mon Jan 01 00:00:00 -0001 1601 irb(main):004:0> Time.parse("Jan 1 1601").to_i => -11644473525 irb(main):005:0> 11644473525 * 10_000_000 => 116444735250000000 This value agrees with your epoch, within 75 leap seconds anyway. If I use ldapsearch against an AD server, and look at attributes like lastLogon, they give plausible answers when parsed using your function (and succeed on a 32-bit machine) Regards, Brian. -- Posted via http://www.ruby-forum.com/.