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.

Ads

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

Advertisements

Ads
Share on Google+Share on Google+

Java Get Time in MilliSeconds

Posted on: October 15, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: Java Get Time in MilliSeconds   View All Comments

Post your Comment


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

Ads

 

Ads