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  

Date:
  1. Date class
  2. Create Date object
  3. Compare two Date value
  4. Convert date value to long value in milliseconds
  5. Convert Date value to String