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

Benoît Minisini gambas at ...1...
Thu Jun 23 08:46:42 CEST 2011


> 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.

Regards,

-- 
Benoît Minisini




More information about the User mailing list