Can I modify window`s clock`s time?

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
Earned a small fee
Earned a small fee
Posts: 15
Joined: Mon Jan 28, 2008 7:03 pm

Can I modify window`s clock`s time?

Post by WxNoob » Fri Feb 29, 2008 11:04 pm


Hello!! did you missed me? lol :wink:

Well, now i have a new project in my mind, well, i started to make it, but i have a doubt...

As you can see in the screenshot, i`m trying to make a simple programme to change the hour of the Window`s clock...

My intention is the next...

Imagine that is 00:00 a.m. and the user puts other hour into the textbox, for example, 02:00 a.m. and the user push the "Cambiar" button, and the clock`s hour changes froom 00:00 to 02:00 a.m.

Is simple what i want to do, i dont know if i had explained myself good, but the problem is that i dont know how to change the windows clock using WxDevC++...

Any ideas please?

Thank you so much :D

wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co

Post by mc2r » Sat Mar 01, 2008 2:02 am

I don't believe there is a way to set the system clock through wxWidgets. I think you will have to resort to using a native api, which won't be protable.

For win32 you can look at ... S.85).aspx

For Linux GTK you can look at

either settimeofday which will set the software clock. If you wish to set the hardware clock on linux you will want to make a system call to /sbin/hwclock

I'm not sure what platform you are developing on if you need to know how to set this on another platform you'll have to specify and someone else will have to jump in.

Last edited by mc2r on Sat Mar 01, 2008 2:49 am, edited 1 time in total.

Post Reply