[Gambas-user] Date(Now) with time component under Ubuntu?

Tobias Boege taboege at gmail.com
Tue Dec 4 11:25:10 CET 2018


On Tue, 04 Dec 2018, Rolf-Werner Eilert wrote:
> This has appeared in another program of mine, and it seems to be a general
> issue with date strings. Now on a DateChooser, I not only get back a day -1
> but also with a time string of 23:00:00. So instead of "12-04-2018" I get
> "12-03-2018 23:00:00".
> 
> I would guess it has to do with Gtk vs Qt, but can it be fixed other than
> waiting for errors and adapting Gambas code?
> 

I had hoped someone more knowledgeable would have answered by now,
but here is what I think: there are actually no time-less dates in
Gambas. When you put a normal Date (with time component) through
the Date() function, you get a Date back which always has its time
component zeroed out. My guess is that the data your program deals
with didn't change between the two distros, but something in the
way it is displayed has --- Gambas version, toolkit, locale, ...?

Disclaimer: not a date specialist. It may be wrong what I said above
about time-less dates not existing, but FWIW the GB_DATE structure
in main/share/gambas.h has a `date` and a `time` member. You can set
one to zero and treat that as a special value, but you can't get
rid of it.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list