Friday, December 31, 2004

Displaying Dates in American Format

Displaying a date field as a text field in a Web application:

Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("mm/dd/yyyy");
sdf.format(now);

Displays the date as : 12/31/2004

No comments:

Post a Comment