> Hi,
>
> I receive a date from a query to the database...let's say rData!x_date ...
>
> The database is set to
> rData = Mglobal.$hConn.Exec("SET SESSION datestyle TO DMY")
>
> DMY data style...the locale of the computer is Italian so DMY also.
>
> If I write  rData!x_date into a GridView or into a string all goes OK,
> but if I write  rData!x_date into a TextBox or into a TextLabel then
> I get MDY format..i.e. the month before the day.
>
> (Gambas 2.14, QT, Gnome, Debian 5.0.1)
>
> Regards
>
> Pino

A date is a date, even if it comes from a database. If you put a date directly 
inside the Text property of a control, a automatic conversion is done by 
internally using CStr(), which is not locale aware. So you have to do:

MyTextBox.Text = Str(rData!x_date)

to use the locale data.

Regards,

-- 
Benoît

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to