in reply to Setting the time on a Windows machine
Difficult to answer authoratatively without knowing more context as to why you want to set the machines time from within a program but this will do it.
WARNING! Be very, very sure that $time has a valid value for a time before doing this!!
For instance. Using a value of "ab:cd" for $time in the following snippet, or even from the command line (under NT4 sp6a) will result in the time being set to 00:00:00!!!
The unix types are gonna have a field day with that one!
... # $time = the time you want to set as "12:45" or "00:00:01" # derived or verified using system calls or modules as # appropriate system( "cmd /c time $time" ); ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Setting the time on a Windows machine
by Aristotle (Chancellor) on Jul 08, 2002 at 13:40 UTC | |
by BrowserUk (Patriarch) on Jul 08, 2002 at 14:50 UTC | |
by Aristotle (Chancellor) on Jul 08, 2002 at 16:48 UTC | |
by BrowserUk (Patriarch) on Jul 08, 2002 at 17:07 UTC |