prlgy 30 mg

Današnji datum u JavaScript – u.

Problem je što izgleda Internet Explorer i FireFox vide datum različito, evo mog rešenja:

    var dt = new Date();
    var intMonth = dt.getMonth() + 1;
    var intDay = dt.getDate();
    var intYear = dt.getYear();

    if (intMonth < 10) {
      intMonth = '0' + intMonth;
    }

    if (intYear < 1900) {
       intYear = intYear + 1900;
    }

    strDt = intYear + '-' + intMonth + '-' + intDay;

    alert (strDt);

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>