Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   servlet code to print date (http://www.go4expert.com/forums/servlet-code-print-date-t24996/)

angad_aks 16Feb2011 10:59

servlet code to print date
 
Code:

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class DATE extends HttpServlet
{
    public void doGet(HttpServletRequest request, HttpServletResponse          response)throws ServletException, IO Exception
    {
        PrintWriter pw=response.getWritet();
        Date today= new Date();
        pw.println("date is");
        pw.println(today);
      }
}



All times are GMT +5.5. The time now is 15:49.