Results 1 to 3 of 3

Thread: Unixtime to int Month? qtmktime("M",unixtime)?

  1. #1
    Join Date
    May 2006
    Posts
    788
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    49
    Thanked 48 Times in 46 Posts

    Default Unixtime to int Month? qtmktime("M",unixtime)?

    qt4
    How to get int Day , int Month from unixtime...


    Qt Code:
    1. uint unixtime =1082370249;
    2.  
    3. QDateTime doi = QDateTime::setTime_t(unixtime);
    To copy to clipboard, switch view to plain text mode 

    main.cpp:30: error: cannot call member function `void QDateTime::setTime_t(uint)
    ' without object ??? I like to set time ....

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Unixtime to int Month? qtmktime("M",unixtime)?

    QDateTime::setTime_t() is not a static method.

    Qt Code:
    1. uint unixtime = 1082370249;
    2. doi.setTime_t(unixtime);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. #3
    Join Date
    May 2006
    Posts
    788
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    49
    Thanked 48 Times in 46 Posts

    Default Re: Unixtime to int Month? qtmktime("M",unixtime)?

    Tanks ..... 1000 ....now to make its similar to php mktime i turn date 5 Hours..on code ..

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.