Results 1 to 7 of 7

Thread: QTableView Date display format difference linux vs. Windows

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QTableView Date display format difference linux vs. Windows

    I wrote an application that displays a table from a mysql db using QTableView. One of the columns is a Date.

    On Windows it displays as yyyy-mm-dd but on linux is shows as yy-mm-dd.

    Same code, same database.

    The database lives on the Windows machine.

    I have verified that the date format of the database is correct by using MySQL Query Browser running on the Linux machine.

    Did I overlook something?

  2. #2
    Join Date
    Aug 2009
    Location
    Greece
    Posts
    69
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView Date display format difference linux vs. Windows

    what you get by running the next code?
    Qt Code:
    1. #include <QtCore/QCoreApplication>
    2. #include <QLocale>
    3. #include <QDebug>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QCoreApplication a(argc, argv);
    8. QLocale l=QLocale::system();
    9. qDebug()<<l.dateFormat(QLocale::ShortFormat);
    10. return a.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Date and Time Difference
    By MIH1406 in forum Newbie
    Replies: 4
    Last Post: 20th August 2012, 15:03
  2. Date format is not display
    By sosanjay in forum Qt Programming
    Replies: 2
    Last Post: 9th November 2009, 10:26
  3. Replies: 1
    Last Post: 15th April 2009, 09:00
  4. Date and Time format.
    By kaushal_gaurav in forum Qt Programming
    Replies: 3
    Last Post: 12th August 2008, 11:36
  5. Replies: 4
    Last Post: 9th January 2008, 15:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.