Convert Date value to String
String toString()
- Converts this Date object to a String of the form:
import java.util.Date;
public class Main {
public static void main(String args[]) {
Date date = new Date();
System.out.println("Date is : " + date.toString());
}
}
The output:
Date is : Sat Oct 30 09:18:38 PDT 2010
Home
Java Book
Essential Classes
Java Book
Essential Classes
Date:
- Date class
- Create Date object
- Compare two Date value
- Convert date value to long value in milliseconds
- Convert Date value to String