[Gambas-user] gb.GeneralDate formatting is inconsistent

Benoît Minisini gambas at ...1...
Sun Feb 5 08:40:28 CET 2012


Le 03/02/2012 05:41, Zach Smith a écrit :
> The gb.GeneralDate formatting appears to be inconsistent in the
> handling of time 00:00:00..
>
>
> Dim d1 As Date, d2 As Date, d3 As Date
>
> d1 = CDate("1/1/2003 00:00:00")
> d2 = CDate("1/1/2003")
> d3 = CDate("00:00:00")
>
> Print Format(d1, gb.GeneralDate)
> Print Format(d2, gb.GeneralDate)
> Print Format(d3, gb.GeneralDate)
>
>
> Results in:
> 01/01/03
> 01/01/03
> 00:00:00
>
> Shouldn't the first line return this?
> 01/01/03 00:00:00
>

Actually the third formatting is inconsistent.

gb.GeneralDate prints the date part the short way (dd/mm/yy) and prints 
the time if it is not zero.

But CDate("00:00:00") is a special value, the "null" date. It should 
print nothing, as IsNull(CDate("00:00:00")) = True.

Regards,

-- 
Benoît Minisini




More information about the User mailing list