Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get NT server date and time.
Message
From
04/06/1999 09:33:15
 
 
To
04/06/1999 07:43:51
Diptesh Patel
Unitelsoftware Ltd.
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00226416
Message ID:
00226472
Views:
30
>How do I get date and time of NT server to register in to log file, from application running from Win 95 node.
>
>TIA

Here's a function I wrote, that doesn't require using the API... seems to work ok.
#DEFINE _SERVER "svrgoliath"
#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
It actually returns a DateTime but you can pull the time out if you want. As you can see, the user will need write,read,delete access on the path you sepcify for this to work.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform