Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need NT server's data & time
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00347804
Message ID:
00347843
Views:
19
>What function or utility I can I use to get the date and time of a NT server from a workstation using VFP?

I use this.. only one person told me it gave them the workstation time, I assumed it had something to do with their servers setup.
#DEFINE _SERVER "svrsbdell1"
#DEFINE _PATH "storage"

function ServerTime( cServerName, cPath )

local cUNC,cTmpFile,tServerTime

if empty( cServerName )
	cServerName = _SERVER
endif
if empty( cPath )
	cPath = _PATH
endif

cTmpFile = '!'+right(SYS(2015),7)+'.tmp'

cUNC = addbs('\\'+cServerName)

if left(cPath,1) = '\'
	cPath = subs(cPath,2)
endif

cUNC = addbs(cUNC+cPath)+cTmpFile

set alternate to ( cUNC )
?
set alternate to

tServerTime = FDATE( cUNC, 1 )

delete file ( cUNC )

return tServerTime
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform