[Gambas-user] Possible CDATE issue Latest version
Benoit Minisini
benoit.minisini at gambas-basic.org
Sun Nov 20 01:18:08 CET 2022
Le 19/11/2022 à 21:14, Brian G a écrit :
>
>
> I am sorry but that is crazy.
> both should use the same conversion as, this is incredibly confusing
> for the user.
No, because Print is intended to be used for printing things to the
user, and so it uses localized conversion.
>
> if i want something other that what print would diplay I can specify the
> correct conversion - cstr(now)
>
> print now
> and
> dim a as string = now
> print a
>
> should by common logic be equivelent, or have more confused users that
> anything else
No, because there are two kinds of strings: those which are displayed to
the user, and must be localized (and usually translated), and those
which are internal and must not be localized.
If you don't specify that explicitly with CStr() and Str(), you rely on
automatic conversion.
As 'Print' is for printing to the user (normally), it assumes localized
strings. Other automatic conversion assumes non localized strings.
In a few words, if you don't get it, don't use implicit conversion.
Always use explicit conversion.
>
> It would simplify so much if what is expected is shown.
> The default conversion should be he same for all uses of the date
> functions and values , and anything else shoul;d be specified.
>
> And what about the date(now) it is not working correctly at all it
> always a returns a time portion when it should only return the date
> according to the documentation. and the time is always 00:00:00 or
> 08:00:00 which is the diffrence to GMT for my location.
>
> This seems so messed up.
No, Date() moves a date/time to the past at midnight in the current
localization. That's all.
Read https://gambaswiki.org/edit/doc/date again and again.
Regards,
--
Benoît Minisini.
More information about the User
mailing list