Re: How to get TIME from NTP
- From: "Gerhard Gentele" <gfgentele@xxxxxxxxxx>
- Date: Thu, 20 Mar 2008 05:13:00 +0100
There always is a "Trick Of The Trade"
Many thanks for your help.
Greetings Gerhard
"Jan Bucek" <bucek.jan@xxxxxxx> schrieb im Newsbeitrag
news:e$QqOIshIHA.6084@xxxxxxxxxxxxxxxxxxxxxxx
Jan Bucek napsal(a):the
Gerhard Gentele napsal(a):
Hi Jan,
yes I know that XP is offering a timeserver option. The point is that
I make
cash register programs for restaurants. On most of their touch
registers we
have W2K running and W2K don't offers this button. Some of them use
the so
called Orderman (device to order wireless). These handhelts a
terminals that
are controlled from a statemachine program (you can control up to 10
devices
with one PC over a RS232 port). To have everywhere the same time was
(VFP9)customers request. Since all the used programes are from us it would
be the
most easy way to do it from the timestuff from the already running
EXE).application. Then nobody has to install anything (besides a new PRG
WINDOWS-DOSBy the way. The Navi server kicket me out (there was now refreshings
anymore
after a few experiments.
But look at this "forgotten secret" below: It gives the time from the
CAESIUM Timeserver in Braunschweig Germany (they make the time there
(smile)). The batch file below is doing the job perfect with
RUNcommands. The only not so nice effect is that written in VFP with the
negative"!" command opens a DOSBOX and that don't looks to good. Second
don'teffect is when the date of the PC don't matches the actual date it
http://search.msdn.microsoft.com/Default.aspx?brand=msdn&locale=en-us&query=shellexecuteupdates the time. But for most (adjusting) needs it will do a good job.
Do you have any idea on how to pack this below UNVISIBLE (without the
RUN
command) in foxpro?
use ShellExecute
declare INTEGER ShellExecute in shell32 INTEGER handle, ;
STRING @ oper, STRING @ ifile, STRING @ iparam, ;
STRING @ ipath, INTEGER showcmd
* showcmd 1 visible 0 hidden
lcFileName = "AdjustTime.bat"
shellexecute(0, "open", lcFileName, "", "c:\", 0)
More about ShellExecute in attachment or consult MSDN:
rem getting time from Braunschweig PTB timeserver
echo off
cls
net stop w32time
rem The adress from the PTB server first adress is: ptbtime1.ptb.de and
second adress ptbtime2.ptb.de
rem one server is always running
NET TIME /SETSNTP:ptbtime1.ptb.de
NET TIME /SETSNTP:ptbtime1.ptb.de /SET /YES
forget it, it is nonsense.
(run "NET HELP TIME" to see short help)
w32tm -once
net start w32time
echo ATOMZEIT IN BRAUNSCHWEIG ABGEHOLT
rem pause
Greetings Gerhard
Hoffentlich hilft es.
Tschuess
.
- References:
- How to get TIME from NTP
- From: Gerhard Gentele
- Re: How to get TIME from NTP
- From: Jan Bucek
- Re: How to get TIME from NTP
- From: Jan Bucek
- Re: How to get TIME from NTP
- From: Gerhard Gentele
- Re: How to get TIME from NTP
- From: Jan Bucek
- Re: How to get TIME from NTP
- From: Jan Bucek
- How to get TIME from NTP
- Prev by Date: Re: Checksum Algorithm
- Next by Date: Re: need name of command interpreter
- Previous by thread: Re: How to get TIME from NTP
- Next by thread: Re: XMLTOCURSOR
- Index(es):
Loading