Results 1 to 9 of 9

Thread: How to change system DateTime?

  1. #1
    Join Date
    Apr 2008
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default How to change system DateTime?

    Hello,
    Can i change system DateTime using QT?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to change system DateTime?

    Have a look at QTimeand QDateTime

  3. #3
    Join Date
    Apr 2008
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to change system DateTime?

    Using these classes i can only get system time, or I mistaken?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to change system DateTime?

    You are not mistaken. You can't change system time using Qt.

  5. #5
    Join Date
    Apr 2008
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to change system DateTime?

    O my god mingw don`t have settimeofday in time.h
    I dont now what to do

  6. #6
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to change system DateTime?

    You will have to refer to different methods as different operating systems have their own restrictions on changing time. For example in Windows you need to be an administrator, so the application can't change the time. Or in Linux you need to be a root user. Perhaps you can call command line arguments?

  7. #7
    Join Date
    Apr 2008
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to change system DateTime?

    Do you mean use a system command "date"?
    I shall try it today.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to change system DateTime?

    Quote Originally Posted by FreePascal View Post
    O my god mingw don`t have settimeofday in time.h
    settimeofday() is a BSD call, so it's not available on Windows.

  9. #9
    Join Date
    Apr 2008
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to change system DateTime?

    I kill problem by using Win API
    Senks to all

Similar Threads

  1. change operating system theme.
    By rajeshs in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2008, 04:02
  2. System environment variable
    By fahlen in forum Qt Programming
    Replies: 4
    Last Post: 27th November 2007, 19:02
  3. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  4. How to change system menu of window?
    By krivenok in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2006, 15:19

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.