Ask a Question related to Ruby, Design and Development.
-
David Garamond #1
64bit timestamp library
I'm looking for a 64bit timestamp definition/standard with suitable
range (at least from year 1900 to 2100) and precision (at least
milliseconds). So far .NET's System.DateTime is the best candidate
(range is year 1 AD to 9999 AD, precision is 0.1 microsecond). However,
conversion to/from UNIX timestamp looks to be non-straightforward. Is
there a Ruby library to do this (or to/from other suitable timestamp)?
I could always invent my own timestamp, but...
--
dave
David Garamond Guest
-
Help Compiling XML::Parser On AIX 5.2 64bit
I'm attempting to get XML::Parser working. Having issues on AIX 5.2 64bit. I've seen a previous message posted months ago with resolution. Has... -
int4 -> unix timestamp -> sql timestamp; abstime?
Hello, what is the opposite of cast(extract('epoch' from now()) as int)? The only thing I found that works is cast(cast(... as abstime) as... -
64bit - 32 bit AIX 5.1 considerations
Dear All, I'm one of the administrators of an AIX 5.1 system (p660 6M 4CPUs). The system is used as a multiuser system in a university... -
~/Library/ vs ~/System/Library vs /User/Library/
In article <110720031327074895%justin.c@se.net>, justin <justin.c@se.net> wrote: First off, you're a little bit confused. ~ means your home... -
32bit or 64bit?
Where can I find whether I have 32bit or 64bit on my Win XP Home edition. System info doesn't seem to tell me. Thanks Greta -- All outgoing... -
T. Onoma #2
Re: 64bit timestamp library
Do me a favor and build you own 128bit timestamp and lets be done with these
restraints. I'm getting shades of Y2K mainia all over again. ;)
On Sunday 23 November 2003 02:29 pm, David Garamond wrote:> I'm looking for a 64bit timestamp definition/standard with suitable
> range (at least from year 1900 to 2100) and precision (at least
> milliseconds). So far .NET's System.DateTime is the best candidate
> (range is year 1 AD to 9999 AD, precision is 0.1 microsecond). However,
> conversion to/from UNIX timestamp looks to be non-straightforward. Is
> there a Ruby library to do this (or to/from other suitable timestamp)?
>
> I could always invent my own timestamp, but...
T. Onoma Guest
-
Charles Hixson #3
Re: 64bit timestamp library
David Garamond wrote:
Given that:> I'm looking for a 64bit timestamp definition/standard with suitable
> range (at least from year 1900 to 2100) and precision (at least
> milliseconds). So far .NET's System.DateTime is the best candidate
> (range is year 1 AD to 9999 AD, precision is 0.1 microsecond).
> However, conversion to/from UNIX timestamp looks to be
> non-straightforward. Is there a Ruby library to do this (or to/from
> other suitable timestamp)?
>
> I could always invent my own timestamp, but...
1 Year = 365.25 days 365 days/year
1 Day = 24 hours 8,766 hours/year
1 Hour = 60 minutes 525,960 minutes/year
1 Minute = 60 seconds 31,557,600 seconds/year
1 Second = 1000 miliseconds 31,557,600,000 ms/year
1 ms = 10 .1 ms 315,576,000,000 .1 ms/year
2 ^ 63 = 9,223,372,036,854,780,000 => 29,227,102 years @ .1 ms
So just pick a good date... say 00:00:00.0000001 01/01/2000 and figure
forwards and backwards from there. Even specifying 0.01 ms resolution
shouldn't hurt you for most purposes. (Actually I meant New Years +
epsilon at Greenwich on the year 2000 CE). But the birthday of Charles
Babbage would be just as good, except for things like the problem of
figuring leap seconds. Since very few people need to worry about leap
seconds I think you can leave worrying about the details required to
handle them until later. Just provide some reasonable way to add in a
table of fudge factors.
Charles Hixson Guest
-
David Garamond #4
Re: 64bit timestamp library
Charles Hixson wrote:
[snip]>>> I'm looking for a 64bit timestamp definition/standard with suitable
>> range (at least from year 1900 to 2100) and precision (at least
>> milliseconds). So far .NET's System.DateTime is the best candidate
>> (range is year 1 AD to 9999 AD, precision is 0.1 microsecond).
>> However, conversion to/from UNIX timestamp looks to be
>> non-straightforward. Is there a Ruby library to do this (or to/from
>> other suitable timestamp)?
>>
>> I could always invent my own timestamp, but...
> Given that: 1 Year = 365.25 days 365 days/year
Thanks for the explanation. I should've completed my previous sentence:
"I could always invent my own timestamp, but... I really don't want to
:)" There are already too many kinds of timestamps out there (MySQL's,
Firebird's, Unix's, PostgreSQL's, Win32's, .NET's, etc).
--
dave
David Garamond Guest
-
David Garamond #5
Re: 64bit timestamp library
T. Onoma wrote:
With 64bit you are quite free to do ranges from thousands of BC to> Do me a favor and build you own 128bit timestamp and lets be done with these
> restraints. I'm getting shades of Y2K mainia all over again. ;)
hundreds of thousands AD with subsecond precision. You don't really need
128bit unless you're doing something like atomic-level time scales (e.g.
picosecond precision) or something like GUID.
But if you want a 128bit timestamp, there's already DJB's libtai:
[url]http://cr.yp.to/libtai.html[/url]
--> On Sunday 23 November 2003 02:29 pm, David Garamond wrote:
>>>I'm looking for a 64bit timestamp definition/standard with suitable
>>range (at least from year 1900 to 2100) and precision (at least
>>milliseconds). So far .NET's System.DateTime is the best candidate
>>(range is year 1 AD to 9999 AD, precision is 0.1 microsecond). However,
>>conversion to/from UNIX timestamp looks to be non-straightforward. Is
>>there a Ruby library to do this (or to/from other suitable timestamp)?
>>
>>I could always invent my own timestamp, but...
dave
David Garamond Guest
-
Josef 'Jupp' SCHUGT #6
Re: 64bit timestamp library
Hi!
* Charles Hixson; 2003-11-23, 23:49 UTC:Or, as w physicist would pput it:> Given that:
> 1 Year = 365.25 days 365 days/year
> 1 Day = 24 hours 8,766 hours/year
> 1 Hour = 60 minutes 525,960 minutes/year
> 1 Minute = 60 seconds 31,557,600 seconds/year
> 1 Second = 1000 miliseconds 31,557,600,000 ms/year
> 1 ms = 10 .1 ms 315,576,000,000 .1 ms/year
>
> 2 ^ 63 = 9,223,372,036,854,780,000 => 29,227,102 years @ .1 ms
2**63 * 0.1 ms = 8 * 10**18 * 0.1 ms = 8 * 10**17 ms
1 yr = PI * 10**7 s = PI * 10**10 ms (1)
PI = 22/7 (2)
8 * 10**17 ms = 8/PI * 10**(17-10) a = 56/22 * 10**7 a = 3 * 10**7 a
(1) Alien but quite precise :->
(2) Any Forth programmers among us?
Josef 'Jupp' Schugt
--
.-------.
message > 100 kB? / | |
sender = spammer? / | R.I.P.|
text = spam? / ___| |___
Josef 'Jupp' SCHUGT Guest



Reply With Quote

