Home » Java Date getTime() Method with Examples

Java Date getTime() Method with Examples

by Online Tutorials Library

Java Date getTime() Method

The getTime() method of Java Date class returns the number of milliseconds since January 1, 1970, 00:00:00 GTM which is represented by Date object.

Syntax:

Parameters

NA

Return

It returns the number of milliseconds since January 1, 1970, 00:00:00 GTM.

Example

Test it Now

Output:

Number of milliseconds science January 1, 1970, 00:00:00 GTM : 60818841000000  

Next Topicjava.util.Date

You may also like