Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

How to get the Server time

Thread view: 
haomingzhou@hotmail.com - 18 Oct 2005 23:13 GMT
I am developing a Web Cient to retrieve the data from the database
server using JSP and Java.

I know I can use "new Date()" to get the time of the Web Client. But I
don't know how to get the server time from Web Client? Any clue of how
to get the server time from web client?

Thanks for your help!
Chris Smith - 18 Oct 2005 23:52 GMT
> I am developing a Web Cient to retrieve the data from the database
> server using JSP and Java.
>
> I know I can use "new Date()" to get the time of the Web Client. But I
> don't know how to get the server time from Web Client? Any clue of how
> to get the server time from web client?

HTTP doesn't have any kind of built-in mechanism for retrieving the
current time from a web server.  Either the server needs to be running a
different protocol (such as NTP or timeofday) that fills that need, or
you need to provide that functionality yourself (e.g., with a servlet or
JSP).

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Roedy Green - 19 Oct 2005 04:08 GMT
On 18 Oct 2005 15:13:27 -0700, haomingzhou@hotmail.com wrote or quoted

>I know I can use "new Date()" to get the time of the Web Client. But I
>don't know how to get the server time from Web Client? Any clue of how
>to get the server time from web client?
send it in a transaction.
or use NTP see http://mindprod.com/Jgloss/ntp.html
See the source code for SetClock. See
http://mindprod.com/products1.html#SETCLOCK

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.