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

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

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

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









Related Tutorials/Questions & Answers:
how to take system date in java servlet?????
How to take control of diffrent system or computer
Advertisements
how to get current date without system date
JSP:How to get year of system date - Date Calendar
How does it take to learn Java
How does it take to learn Java
How does it take to learn Java
Maven dependency for biz.enef - surf-rest-servlet_2.11 version 0.0.1 is released. Learn to use surf-rest-servlet_2.11 version 0.0.1 in Maven based Java projects
Maven dependency for servlets.com - cos version 05Nov2002 is released. Learn to use cos version 05Nov2002 in Maven based Java projects
getting current date without using system date - Date Calendar
How to compare date in Java?
how to add date and change date in java - netbeans
how to take backup of phone to pc using java code
Artifacts of servlets.com
how to take a backup of a table in sql
Maven Repository/Dependency: servlets.com | cos
How to get the current date in Java?
How to calculate Date Difference in Java?
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for scalamachine-servlet_2.10 version 0.4.2
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for scalamachine-servlet_2.10 version 0.4.1
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for scalamachine-servlet_2.10 version 0.4.0
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for scalamachine-servlet_2.10 version 0.3.0
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for scalamachine-servlet_2.10 version 0.5.0
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for scalamachine-servlet_2.10 version 0.3.1
How to convert date to string in Java?
Maven Repository/Dependency: biz.enef | surf-rest-servlet_2.11
Version of servlets.com>cos dependency
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
java program to take backup for the folders
How to Store Date - Java Beginners
Where to take online Java Training?
How many days it will take to learn Docker
Maven Repository/Dependency: com.stackmob | scalamachine-servlet_2.10
Servlet.init() for servlet FacesServlet threw exception
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
date
date
take variables in text file and run in java
how to get date format in string from date object containing real date in java
how to get date format in string from date object containing real date in java
How long will it take to learn Spring boot
How long will it take to learn Spring boot
Java current date - How to get current date in Java

Ads