PDA

View Full Version : Date format is not display



sosanjay
9th November 2009, 07:22
Hi,

I am inserting the date in database in the string format dd/MM/yyyy

but when I display the date in table the format is change and it display yyyy/MM/dd


QString cdate = date.currentDate().toString("dd/MM/yyyy");


Its a simple question Can anyone tell me that Why it occur?

caduel
9th November 2009, 09:46
I guess the date is not inserted as string but as date type.
When you select from your table the date then is displayed in the default format of a date.

Solution:
* insert the date "as a date"
* either use some special function in your select call (in Oracle you can tell the db to format a date (as a string) in some format)
* or "tell" your view (whatever you are using) to format dates the way you want to see them.

sosanjay
9th November 2009, 10:26
In my database field is by default date.
I think your logic works.Thanks