Results 1 to 3 of 3

Thread: QDate without additional character

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    273
    Qt products
    Qt3 Qt4
    Platforms
    Windows
    Thanks
    42
    Thanked 1 Time in 1 Post

    Default Re: QDate without additional character

    Hi,

    I could solve it

    Qt Code:
    1. QDateTime dt = QDateTime::currentDateTime();
    2. QString datum = dt.toString();
    3.  
    4. datum.replace( ".", " " );
    5. datum.replace( ":", " " );
    To copy to clipboard, switch view to plain text mode 

    thx
    Think DigitalGasoline

  2. #2
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: QDate without additional character

    Qt Code:
    1. QDateTime dt = QDateTime::currentDateTime();
    2. QString datum = dt.toString("ddd dd MMM hh mm ss yyyy");
    To copy to clipboard, switch view to plain text mode 
    Everything is in the docs did you bother reading them?

Similar Threads

  1. Problems with QDate
    By cyberboy in forum Qt Programming
    Replies: 4
    Last Post: 25th May 2008, 21:17

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.