Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates

Status
Not open for further replies.

abig99

Programmer
Oct 22, 2001
53
GB
Will be looking through some more sites but no luck yet.
I have many users all linked to a server which contains the backend of our database, because users have a habit of playing with the local PC Dates and times, i need a way of referencing the server date instead of the local PC date.

Any thoughts would be greatly appreciated
Many Thnx
 
Decided more info may be needed as i have found a solution that works on NT, but not on windows 2000.
Server runs on windows 2000 :eek:)

heh, well ok, not much updating
 
Hi.

I know that "net time" works, if you run the following command in a dos prompt, and presuming your server is called myserver, then this will return the current date and time according to the server.

eg. net time \\myserver

However, how to get access to recieve the text of the command is another project!

I would assume that Shell("Net time \\myserver") would work, but this only returns wether the command ran sucessfully or not.

Any Suggestions?

Mr Big

Net time
--------


Synchronizes the computer's clock with that of another computer or domain. Used without parameters, net time displays the time for another computer or domain.

Syntax
net time [{\\ComputerName | /domain[:DomainName] | /rtsdomain[:DomainName]}] [/set]

net time [\\ComputerName] [/querysntp] [/setsntp[:NTPServerList]]

Parameters
\\ComputerName
Specifies the name of a server you want to check or with which you want to synchronize.
/domain[:DomainName]
Specifies the domain with which to synchronize clocks.
/rtsdomain[:DomainName]
Specifies the domain of the Reliable Time Server with which to synchronize clocks.
/set
Synchronizes the computer's clock with the time on the specified computer or domain.
/querysntp
Displays the name of the Network Time Protocol (NTP) server currently configured for the local computer or the one specified in ComputerName.
/setsntp[:NTPServerList]
Specifies a list of NTP time servers to be used by the local computer. The list can contain IP addresses or DNS names, separated by spaces. If you use multiple time servers, you must enclose the list in quotation marks.
net help command
Displays help for the specified net command.
Formatting legend
Format Meaning
Italic Information that the user must supply
Bold Elements that the user must type exactly as shown
Ellipsis (...) Parameter that can be repeated several times in a command line
Between brackets ([]) Optional items
Between braces ({}); choices separated by pipe (|). Example: {even|odd} Set of choices from which the user must choose only one
Courier font Code or program output

Related Topics
Dont be small. be BIG
 
Thnx Mr Big

Not really something i can use, and like ya say not sure how to get the response to the database, was looking for an access VB method for getting the time from a different server, although will keep ya updated if i find something from another site.

Suggestions more than welcome, bring em on peeps.
Thnx in advance
 
ok here it is, i found the answer, thought i would let you all know, this code added to sql procedure and a pass through query returns the date, you then do a lookup on the query to get the date, and there you are, the date in a variable. You also need to close the query at this point.the connection string can be set inside the pass through query so not reconnecting to the sqlserver.

heres the link where the code was attained :) nice one SQL Team.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top