PP.Date.format(date, format): String;
date. Date. Date.
format. String | PP.Date.Pattern. The format, to which the date should be converted.
The formatstatic method returns formatted date.
The method returns an object of the String type.
To execute the example, add a link to PP.js scenario file to HTML page.
// Create the current date date = new Date(); // Set date format format = PP.Date.Pattern.ShortDate; // Get date in the short date format newDate = PP.Date.format(date, format); console.log(newDate);
After executing the example the date is presented in the short format.
See also: