Home » Java Date parse() Method with Examples

Java Date parse() Method with Examples

by Online Tutorials Library

Java Date parse() Method

The parse() method of Java date class tries to interpret the string ‘s’ as date and time representation. If this attempt is successful then it will return number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this string argument.

This method is deprecated as of JDK version 1.1 and replaced by DateFormat.parse(String s)

Syntax:

Parameters

s – a string to be parsed as a date

Return

The parse() method returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this string argument.

Example 1

Test it Now

Output:

Milliseconds from date string 's' is : 857932200000  

Next TopicJava Util Date

You may also like