PDA

View Full Version : How to change system DateTime?



FreePascal
4th April 2008, 14:27
Hello,
Can i change system DateTime using QT?

aamer4yu
4th April 2008, 19:46
Have a look at QTime and QDateTime

FreePascal
4th April 2008, 21:35
Using these classes i can only get system time, or I mistaken?

wysota
4th April 2008, 21:53
You are not mistaken. You can't change system time using Qt.

FreePascal
5th April 2008, 00:19
O my god mingw don`t have settimeofday in time.h
I dont now what to do :confused: :crying:

codeslicer
5th April 2008, 01:15
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?

FreePascal
5th April 2008, 07:51
Do you mean use a system command "date"?
I shall try it today.

wysota
5th April 2008, 07:57
O my god mingw don`t have settimeofday in time.h

settimeofday() is a BSD call, so it's not available on Windows.

FreePascal
5th April 2008, 14:50
I kill problem by using Win API
Senks to all