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

Related Tutorials


 
 

Share on Google+Share on Google+

Java Get Time in MilliSeconds

Advertisement
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

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 15, 2008

Related Tutorials

Discuss: Java Get Time in MilliSeconds   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com