In this section, you will learn to convert a date into milliseconds. A millisecond is one thousand part of a second i.e. an unit for measuring the time.
Description of program:
This example helps you in converting a date into milliseconds. The Date() constructor represents the current date (time) in GMT (Greenwich Mean Time) format. Here we use the getTime() method. This method converts the date into milliseconds as long type.
Here is the code program:
Output of program:
C:\date>java DateToMilliseconds Today is 1181644914093
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: June 14, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles