Convert Date value to String

ReturnMethodSummary
StringtoString()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
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.