Skip to content

SHDate.clone()

Get a branch from the using class

Try it


Syntax

clone();

Return value

Returns a branch of the class in use

Examples

var shdate = new SHDate("Dey 25, 1390 23:15:30");
var clone = shdate.clone();

console.log(shdate.toString()); // "Sun 25 Dey 1390 23:15:30 GMT+0330 (Iran Standard Time)"
shdate.setMonth(11);
console.log(shdate.toString()); // "Thu 25 Esf 1390 23:15:30 GMT+0330 (Iran Standard Time)"

console.log(clone.toString()); // "Sun 25 Dey 1390 23:15:30 GMT+0330 (Iran Standard Time)"

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/clone