[Gambas-user] Date fun again - IsDate and CDate localisation?

KKing kicking177 at gmail.com
Wed Dec 23 13:42:41 CET 2020

So I'm in UK so expect dates in format dd/mm/yyyy using G 3.12.2 on 
trying to validate a source feed file ...  I have the following.

> Dim strTest As String
> Dim dteTest As Date
> strTest = "14/01/2000 00:00:00"
> If IsDate(strTest) Then
>    dteTest = CDate(strTest)
> Else
>    dteTest = CDate(strTest)
> Endif 

When I have strTest = "14/01/2020 00:00:00" it passes the "IsDate" test 
but then fails on the CDate line with "type mismatch: wanted Date, got 
string instead.

If I have strTest = "01/14/2020 00:00:00" it passes both ... why?

Is there some sort of localisation within Gambas I have to set?


More information about the User mailing list