Home Java Java-get-example Java Get Time in MilliSeconds



Java Get Time in MilliSeconds
Posted on: October 15, 2008 at 12:00 AM
If you wanted to show the time in milliseconds since the particular time, go through the below given example that illustrate how to get the time in milliseconds.

Java Get Time in MilliSeconds

     

If you wanted to show the time in milliseconds since the particular time, go through the below given example that illustrate how to get the time in milliseconds. Please do not forget to import the java.util.calender package as it contains all the mechanism to show the time and date etc..

 

 

 

Java Syntax to get time in milliseconds

import java.util.Calendar;

public class GetTimeInMilliSeconds {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance();
System.out.println("Current milliseconds since 13 Oct, 2008 are :"
+ cal.getTimeInMillis());
}
}

Output will be displayed as:

Download Source Code

Related Tags for Java Get Time in MilliSeconds:
javacantdatetimeimportgetportaipackageshowifforexampletocontainsexamsheilitnotliulimartceinnopartcalasmmillisecondsntpartrwancajpackthroughendaseallagemillisecondicumehowhrrateackdoxaxampsatpackincishaimellivnismplgoeaandarstrrtsecondsutilwantvautissthshocondavbelosthatetcforgeetcorgpleplmindono


More Tutorials from this section

Ask Questions?    Discuss: Java Get Time in MilliSeconds   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.