Hi All,

How to get time value from another machine (server or another)?
Client's OS could be Win98, NT, ME, W2K, or XP
May be it need WinAPI, how is the easiest way to implement ?

Thanks in advanced

I'm using VFP 7.0

Re: server time by François

François
Wed Sep 15 01:42:07 CDT 2004

to set up time on the local station from the clock of a server
NET TIME \\Server /set /yes
put it in the Start menu and it will automatically do that each time you
launch the computer


"budieko" <eko_dja@myrealboxJUSTREMOVE.com> a écrit dans le message de
news:ep19AgumEHA.648@tk2msftngp13.phx.gbl...
> Hi All,
>
> How to get time value from another machine (server or another)?
> Client's OS could be Win98, NT, ME, W2K, or XP
> May be it need WinAPI, how is the easiest way to implement ?
>
> Thanks in advanced
>
> I'm using VFP 7.0
>
>



Re: server time by Eric

Eric
Wed Sep 15 01:45:01 CDT 2004

Hello, budieko!
You wrote on Wed, 15 Sep 2004 13:04:17 +0700:

b> How to get time value from another machine (server or another)?
b> Client's OS could be Win98, NT, ME, W2K, or XP
b> May be it need WinAPI, how is the easiest way to implement ?

Create a temp file on the remote machine over the network and get the file
datetime with ADIR().
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Re: server time by Mya

Mya
Wed Sep 15 04:07:04 CDT 2004

cool idea eric!

"Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
news:uTC5X9umEHA.744@TK2MSFTNGP10.phx.gbl...
> Hello, budieko!
> You wrote on Wed, 15 Sep 2004 13:04:17 +0700:
>
> b> How to get time value from another machine (server or another)?
> b> Client's OS could be Win98, NT, ME, W2K, or XP
> b> May be it need WinAPI, how is the easiest way to implement ?
>
> Create a temp file on the remote machine over the network and get the file
> datetime with ADIR().
> --
> Eric den Doop
> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
>
>



Re: server time by Leemi

Leemi
Wed Sep 15 09:19:06 CDT 2004

Hi budieko:

You can also use the NetRemoteTOD API function as shown in this article:

249716 How To Use NetRemoteTOD to Obtain Date and Time Information from a
Server
http://support.microsoft.com/?id=249716

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/

*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003


>to set up time on the local station from the clock of a server
>NET TIME \\Server /set /yes
>put it in the Start menu and it will automatically do that each time you
>launch the computer


>"budieko" <eko_dja@myrealboxJUSTREMOVE.com> a écrit dans le message de
>news:ep19AgumEHA.648@tk2msftngp13.phx.gbl...
> Hi All,
>
> How to get time value from another machine (server or another)?
> Client's OS could be Win98, NT, ME, W2K, or XP
> May be it need WinAPI, how is the easiest way to implement ?
>
> Thanks in advanced
>
> I'm using VFP 7.0
>
>



Re: server time by budieko

budieko
Wed Sep 15 19:38:38 CDT 2004

Thank's for all, I love this group



Re: server time by budieko

budieko
Thu Sep 16 22:31:08 CDT 2004

Sorry for bothering again
I'm so careless for not testing this completely first.
I don't find any command in my VFP 7.0 that can create a file with
date and time of remote machine, except CREATE TABLE and INDEX ON.

I have tried FCREATE, STRTOFILE, any COPY commands, RENAME,
EXPORT, any SAVE commands, and any DISPLAY commands. All of them
create a file in remote machine with date and time of local machine.

What am I missing ?

Thanks again

"Mya Ravis" <myaravis@nonameaddress.noname> wrote in message
news:#xeLcNwmEHA.3608@TK2MSFTNGP09.phx.gbl...
> cool idea eric!
>
> "Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
> news:uTC5X9umEHA.744@TK2MSFTNGP10.phx.gbl...
> > Hello, budieko!
> > You wrote on Wed, 15 Sep 2004 13:04:17 +0700:
> >
> > b> How to get time value from another machine (server or another)?
> > b> Client's OS could be Win98, NT, ME, W2K, or XP
> > b> May be it need WinAPI, how is the easiest way to implement ?
> >
> > Create a temp file on the remote machine over the network and get the
file
> > datetime with ADIR().
> > --
> > Eric den Doop
> > www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
> >
> >
>
>



Re: server time by budieko

budieko
Thu Sep 16 23:55:57 CDT 2004

Bingo,

I have closed the file created by FCREATE before the ADIR command,
so the date and time is marked as my local machine

FCLOSE should appear after ADIR command

Now, It works :)


"budieko" <eko_dja@myrealboxJUSTREMOVE.com> wrote in message
news:OOMN8u5mEHA.2076@TK2MSFTNGP15.phx.gbl...
> Sorry for bothering again
> I'm so careless for not testing this completely first.
> I don't find any command in my VFP 7.0 that can create a file with
> date and time of remote machine, except CREATE TABLE and INDEX ON.
>
> I have tried FCREATE, STRTOFILE, any COPY commands, RENAME,
> EXPORT, any SAVE commands, and any DISPLAY commands. All of them
> create a file in remote machine with date and time of local machine.
>
> What am I missing ?
>
> Thanks again
>
> "Mya Ravis" <myaravis@nonameaddress.noname> wrote in message
> news:#xeLcNwmEHA.3608@TK2MSFTNGP09.phx.gbl...
> > cool idea eric!
> >
> > "Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
> > news:uTC5X9umEHA.744@TK2MSFTNGP10.phx.gbl...
> > > Hello, budieko!
> > > You wrote on Wed, 15 Sep 2004 13:04:17 +0700:
> > >
> > > b> How to get time value from another machine (server or another)?
> > > b> Client's OS could be Win98, NT, ME, W2K, or XP
> > > b> May be it need WinAPI, how is the easiest way to implement ?
> > >
> > > Create a temp file on the remote machine over the network and get the
> file
> > > datetime with ADIR().
> > > --
> > > Eric den Doop
> > > www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By
VFP8
> > >
> > >
> >
> >
>
>



Re: server time by Andrew

Andrew
Tue Sep 21 04:57:57 CDT 2004

budieko wrote:
> Hi All,
>
> How to get time value from another machine (server or another)?
> Client's OS could be Win98, NT, ME, W2K, or XP
> May be it need WinAPI, how is the easiest way to implement ?
>
> Thanks in advanced

Just for an older and less elegant way to do this (and I see you have solved
the problem anyway ;)) that I happen to have been
putzing about with in relation to something different (rename a file to
today's date and time from a batch file) ;-)...

@ECHO OFF
:: this derivation of FOR only works on NT (ie no 9x, yes 2K, XP, NT)

FOR /F "tokens=6-7 delims= " %%a IN ('NET TIME \\servername') DO (
ECHO date=%%a
ECHO time=%%b
)

Copy the above to a batch file (say, "stime.bat") and replace \\servername
with the machine you wish to check the time of, then run it.

--
Regards
Andrew Howell