File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Server Date!!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Server Date!!!!" Watch "Server Date!!!!" New topic

Server Date!!!!

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
if u post a message in this forum, after ur name ,date is there and that date is the server date date not the client date.
can anyone plz tell me ,what is the technique we can use to implement this and how ?if u can help me with regard to servlet,that will be better.
R Mutum

Joined: Sep 07, 2000
Posts: 4
You will get the server date as long as the code runs on the server. You can put the following code in a jsp page or a servlet:
java.util.Date today = new java.util.Date();
out.println("Today is :" + today);
If you want the client date, you have to use JavaScript or VBscript that runs on the client.

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
i got the date ,actually the problem was with my server only.
i had used the same method,now server is ok.
Thanks, for ur advice.
wood burning stoves
subject: Server Date!!!!
It's not a secret anymore!