473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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 4582

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
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.