Message-ID: <16803.24473.589089.159051@gargle.gargle.HOWL>
Date: 2004-11-23T16:04:41Z
From: Martin Maechler
Subject: timeDate
In-Reply-To: <OFBA4A6C22.4AAA94E7-ON85256F55.005581ED@nd.convergys.com>
>>>>> "james" == james holtman <james.holtman at convergys.com>
>>>>> on Tue, 23 Nov 2004 10:39:04 -0500 writes:
james> You might want to check out 'chron'. This stores the
james> time as days and fractions of a day.
james> If you take the current date,
>> as.numeric(chron(dates.="11/23/2004"))
james> [1] 12745
>>
james> you get the value above. If you change this to
james> millisecond, you get
>> as.numeric(chron(dates.="11/23/2004")) * 86400 * 1000
james> [1] 1.101168e+12
>>
james> this value requires 46 bits and since a floating
james> point number has 54 bits of value,
no, only 52 bits (64 = 52+1+12+1) with sign bits for exponent
and mantissa.
james> it should be enough to give you millisecond resolution and still
james> maintain the 'date'