FileDocCategorySizeDatePackage
CurrentTime.javaAPI DocExample674Tue Jan 25 10:45:12 GMT 2000None

CurrentTime

public class CurrentTime extends HttpServlet

Fields Summary
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)


    //PrintWriter out = res.getWriter();
    PrintWriter out = new PrintWriter(res.getOutputStream(), true);

    Date date = new Date();
    DateFormat df = DateFormat.getInstance();

    String zone = req.getParameter("zone");
    if (zone != null) {
      TimeZone tz = TimeZone.getTimeZone(zone);
      df.setTimeZone(tz);
    }

    out.println(df.format(date));