[Gambas-user] Format function changes date value

Benoît Minisini g4mba5 at gmail.com
Thu Jun 7 16:35:55 CEST 2018


Le 07/06/2018 à 16:26, Gianluigi a écrit :
> 
> I believe that coercion should always be avoided.
> You have passed a string to a date type:
>     Dim Dat1 As Date
>     Dat1 = "6/1/2018"
> By writing Dat1 = CDate ("6/1/2018") the error would have been avoided.
> 
> Regards
> Gianluigi
> 

Of course not, as Dat1 = "6/1/2018" and Dat1 = CDate("6/1/2018") do 
exactly the same thing.

-- 
Benoît Minisini


More information about the User mailing list