[Solved] Change a html link destination on date in the future


<script type="text/javascript">
function callFunc() {
    var compareDate = new Date(2013, 0, 31, 0, 0, 0, 0);
    alert("compareDate: " + compareDate.toString());
    var curDate = new Date();
    if (curDate.getTime() > compareDate.getTime()) {
        return "http://www.yahoo.com";
    } else {
        return "http://www.google.com";
    }
}
document.write('<a href="' + callFunc() + '">Link</a>');
</script>

solved Change a html link destination on date in the future