hello..
actually i am entering starting date. and also giving period in digits.for example 2yrs. to day date 22/01/2010. after 2years that date will 22/01/2012.
how to find end date using javascript.
hello..
actually i am entering starting date. and also giving period in digits.for example 2yrs. to day date 22/01/2010. after 2years that date will 22/01/2012.
how to find end date using javascript.
hello..
actually i am entering starting date. and also giving period in digits.for example 2yrs. to day date 22/01/2010. after 2years that date will 22/01/2012.how to find end date using javascript.
i found script but display date only. how to display date only.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
Date.prototype.addMonths = function (n) {
var day = this.getDate();
this.setMonth(this.getMonth() + n);
if (this.getDate() < day) {
this.setDate(1);
this.setDate(this.getDate() - 1);
}
return this;
}
var d = new Date("jan 22, 2010");
alert(d.addMonths(24));
</script>
</head>
<body>
</body>
</html>
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.