getDateToStr (date);
date. Sets date value.
The getDateToStr method converts date into a string and returns it.
To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and the following code must be added in the document opening event handler:
var changeAlertDateButt = new PP.Ui.Button( { ParentNode: document.body, //DOM parent node Content: "Get Date", //text Click: PP.Delegate(onClickAlertDate) }); function onClickAlertDate() { //Create a new date object var date = new Date(); //Transform date to string var stringDate = tsService.getDateToStr(date); alert(stringDate); }
After executing the example a button named Get Date is placed on the HTML page. On clicking the button the current date in string format is shown in the screen
See also: