Date Date = new Date(); //Define a current date, and the output is date type.
simple date format SDF = new simple date format(" yyyy-MM-DD HH:MM:ss "); //Create format date type
string str = SDF . format(date); //Print format creation date. At this point, the output is a string date type.
Output result: 2015-6-3019:17: 32.