[Gambas-user] gb3: date/time reporting odd fractional value

Kevin Fishburne kevinfishburne at ...1887...
Thu Jun 23 09:16:13 CEST 2011


On 06/23/2011 02:46 AM, Benoît Minisini wrote:
>> According to some previous answers to my questions about performing
>> arithmetic operations on dates and times, the fractional part of a date
>> (cfloat[now] - fix[cfloat(now)]) represents the time of day and the
>> integer part (fix[cfloat(now)]) represents the number of days elapsed
>> since the beginning of time.
>>
>> So if it's 12:00 PM then cfloat(now) should display x.5, meaning half
>> the day has passed.
>>
>> If I enter ?cfloat(now) in the immediate window I get something like
>> 2487839.71017654 even though it's 10:02 PM. If x.0 is midnight, x.5 is
>> noon, etc., how is x.7 10:00 PM? Shouldn't 10:00 PM be something closer
>> to x.916666674?
>>
>> I thought at first it was because I was scaling time, but the immediate
>> window proved that wrong (immediately!). Any insight appreciated as always.
> Date/time values are internally stored in GMT time.

I'm reading about GMT on Wikipedia now... How would one interpret the 
returned values with respect to GMT?

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271





More information about the User mailing list