473,498 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set the pc clock

Hard to believe but I can't find anything that shows how to set the clock
programmatically with VB.NET

I do not want to use the net time command.

Thanks.
Nov 22 '05 #1
10 4583

Why not call directly the control panel dialog like this:

Process.Start( "control.exe", "timedate.cpl" );

Lionel.

"Joel" <Jo**@discussions.microsoft.com> a écrit dans le message de news:
3B**********************************@microsoft.com...
Hard to believe but I can't find anything that shows how to set the clock
programmatically with VB.NET

I do not want to use the net time command.

Thanks.

Nov 22 '05 #2

Why not call directly the control panel dialog like this:

Process.Start( "control.exe", "timedate.cpl" );

Lionel.

"Joel" <Jo**@discussions.microsoft.com> a écrit dans le message de news:
3B**********************************@microsoft.com...
Hard to believe but I can't find anything that shows how to set the clock
programmatically with VB.NET

I do not want to use the net time command.

Thanks.

Nov 22 '05 #3
Any suggestions beside the use of a CPL file ? There has to be a way of
doing this with some functions somewhere !?

"Joel" wrote:
Hard to believe but I can't find anything that shows how to set the clock
programmatically with VB.NET

I do not want to use the net time command.

Thanks.

Nov 22 '05 #4
Any suggestions beside the use of a CPL file ? There has to be a way of
doing this with some functions somewhere !?

"Joel" wrote:
Hard to believe but I can't find anything that shows how to set the clock
programmatically with VB.NET

I do not want to use the net time command.

Thanks.

Nov 22 '05 #5
Check out the SetSystemTime function in the coredll.dll. There is a
good example of using it here
http://www.pinvoke.net/default.aspx/...ystemTime.html

Nov 22 '05 #6
Check out the SetSystemTime function in the coredll.dll. There is a
good example of using it here
http://www.pinvoke.net/default.aspx/...ystemTime.html

Nov 22 '05 #7
Now you're talking ! I also found a really good one from the .net framework
SDK

Program Files\Microsoft Visual Studio .NET
2003\SDK\v1.1\Samples\Technologies\Interop\Platfor mInvoke\WinAPIs\VB\SysTime.vb

BY the way, is there anything similar to get the system time from a remote
computer?

"Jamin Guy" wrote:
Check out the SetSystemTime function in the coredll.dll. There is a
good example of using it here
http://www.pinvoke.net/default.aspx/...ystemTime.html

Nov 22 '05 #8
Now you're talking ! I also found a really good one from the .net framework
SDK

Program Files\Microsoft Visual Studio .NET
2003\SDK\v1.1\Samples\Technologies\Interop\Platfor mInvoke\WinAPIs\VB\SysTime.vb

BY the way, is there anything similar to get the system time from a remote
computer?

"Jamin Guy" wrote:
Check out the SetSystemTime function in the coredll.dll. There is a
good example of using it here
http://www.pinvoke.net/default.aspx/...ystemTime.html

Nov 22 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6681
by: James Harriman | last post by:
Hi, I need to be able to measure a time interval in milliseconds on a windows machine. I have tried using time.clock() but it appears to measure time in seconds...Is there a way to measure time...
9
2227
by: Gino Elloso - Philippines | last post by:
Hello, I made a webpage ( @ Geocities Free Webpages ) that contains a mousetrail clock script. I simply copied the script ( including all html tags ) exactly as it was from a source webpage (...
8
3385
by: peterbe | last post by:
What's the difference between time.clock() and time.time() (and please don't say clock() is the CPU clock and time() is the actual time because that doesn't help me at all :) I'm trying to...
0
408
by: Peger, Daniel H. | last post by:
Hi, I'm having a slight problem with the precision of the standard c++ clock function as it is defined in time.h . On my system the shortest meassurable time period is 0.01 seconds, but for my...
5
5926
by: Pushkar Pradhan | last post by:
I've decided to use clock() to time my routines, my code is like this: clk1 = clock(); while (n != 1000000) { mm_2r2c_2r2c_bc(&a, &b, &c); n++; } clk2 = clock(); t2 = time(NULL);...
33
47567
by: Pushkar Pradhan | last post by:
I'm using clock() to time parts of my code e.g. clk1 = clock(); /* code */ clk2 = clock(); /* calculate time in secs */ ...... clk1 = clock(); /* code */ clk2 = clock();
54
3937
by: CoreyWhite | last post by:
The following experiment is a demonstration of TIME TRAVEL. When writing this program, and testing it out I found that sometimes the program would engage itself in time travel but other times it...
12
4062
by: cenktarhancenk | last post by:
is there a way to display a ticking clock in a web page using javascript? but not in a textbox, rather as text that i can change the style, font etc. cenk tarhan
5
5628
by: yinglcs | last post by:
Hi, I am following this python example trying to time how long does an operation takes, like this: My question is why the content of the file (dataFile) is just '0.0'? I have tried "print...
5
6920
by: none | last post by:
Hello, can you help? if I include: #include <time.h> and run the code: clock_t t = clock(); cout << "t is " << t << endl; I get (seemingly randomly) "t is 0" or "t is 10000"
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.