Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  
 

how to take system date in java servlet?????

Ads

 
 

Share on Google+Share on Google+

sandip gorde
how to take system date in java servlet?????
1 Answer(s)      6 years and 8 months ago
Posted in : Java Beginners

how to take system date in java servlet?????

Ads
View Answers

December 6, 2010 at 3:43 PM


Hi Friend,

Try the following code:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class SystemDate extends HttpServlet { 
    public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException {
        res.setContentType("text/html");
        PrintWriter out = res.getWriter();
        long time = System.currentTimeMillis();
        Date date = new Date(time);
        out.println(date.toString());

        }
        }

Thanks


Ads









Related Tutorials/Questions & Answers:
Advertisements