toString()

Creates a string by formatting the value of the date according to pattern.

Syntax

String  toString(String pattern)
  1. pattern follows the formatting rules defined by java.text.SimpleDateFormat.