Setting The Time
How do you set the date and time of your system clock using C++ to whatever date and time you want, if possible?
You have to use OS-specific calls. You may also need to have the proper privildges (e.g. on windows you need to be an admin to set the clock).
you can do this in assembler, so your just OS doesnt matter at all (of course you need the privilegs to do this too)
the correct assembler instruction for an x86 : ..... cant remember sorry
(i will search for it in my books a little)
Its Interupt 21h Function 02DH
data looks like this:
AH=02Dh
CH= hours (0-23)
CL= mins (0-59)
DH= secs (0-59)
DL= secs/100 (0-99)
may be useful for some crossplatforming
the correct assembler instruction for an x86 : ..... cant remember sorry
(i will search for it in my books a little)
Its Interupt 21h Function 02DH
data looks like this:
AH=02Dh
CH= hours (0-23)
CL= mins (0-59)
DH= secs (0-59)
DL= secs/100 (0-99)
may be useful for some crossplatforming
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement