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

Rolf-Werner Eilert rwe-sse at osnanet.de
Tue Dec 4 11:23:20 CET 2018


To give you an idea of the problem, here is a code snippet from this 
second application, it is in Form_Open:

-----
   t$ = Date(Now)
   heute = String.Mid(t$, 4, 2) & "-" & String.Left(t$, 2) & "-" & 
String.Mid(t$, 7, 4)
   DerTag.Tag = Date(Now)
   DerTag.Text = "heute, " & Wochentag(Date(Now)) & ", " & 
Replace(heute, "-", ".")
-----



Today (4th December)
- t$ becomes "12.03.2018 23:00:00"
- 'heute' of course becomes "12-03-2018"

Now it's curious:
- DerTag.Tag becomes "04.12.2018 00:00:00" i. e. day and hour +1 !!

And of course, it goes wrong here:
- DerTag.Text becomes "heute, Dienstag, 03.12.2018"


How to solve this mess???

Regards
Rolf


Am 01.12.18 um 16:22 schrieb Rolf-Werner Eilert:
> Just found this strange thing:
> 
> Up to now I was under Suse with KDE. In one of my programs, I use 
> Date(Now) which - as the documentation says - delivers the date 
> component only.
> 
> It did so under Suse, but under Ubuntu Mate I get a runtime error, and 
> when I search the reason for it I find that Date(Now) delivers a locale 
> date + time of 00:00:00.
> 
> I found a quick workaround in my program for it, but it's strange, isn't 
> it?
> 
> Regards
> Rolf
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 
> 



More information about the User mailing list