Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Dan Ebberts

    August 11, 2010 at 8:12 pm

    This source text expression should do it:

    D = new Date(Date(0));
    “” + D.getDate() + “/” + (D.getMonth()+1) + “/” + D.getFullYear()

    Dan

  • Anthony Dupsta

    August 16, 2010 at 6:00 pm

    Dan,
    I just wanted to say thank you very much for “current date script.” I know it seems like a minor thing, but it is so nice not to have to deal with hand doing certain things over and over! Great script

  • Damien Ivan

    June 30, 2014 at 7:09 pm

    Holy crap! Thanks so much! Date(0)! I would never have figured that out in a million years. I would have assumed that would return Jan 1st, 1970. Thanks again.

  • Ceng Cung

    June 16, 2016 at 8:57 am

    Thanks for how to get current date.
    After some googling i have modified to get months as names.
    It works, but did not display latin-extended characters.

    I tried with ascii and did not work too.
    Is there any way to display latin-extended characters…

    month = new Array();
    month[0] = "Ocak";
    month[1] = "Şubat";
    month[2] = "Mart";
    month[3] = "Nisan";
    month[4] = "Mayıs";
    month[5] = "Haziran";
    month[6] = "Temmuz";
    month[7] = "Ağustos";
    month[8] = "Eylül";
    month[9] = "Ekim";
    month[10] = "Kasım";
    month[11] = "Aralık";

    D = new Date(Date(0));
    "" + D.getDate() + " " + month[(D.getMonth())] + " " + D.getFullYear()

  • Daniel Buckland

    February 6, 2023 at 12:09 am

    If you copy and paste Dan Ebberts text, it throws up a syntax error casue the quatation marks copy wrong.

    Here’s a fixed version

    d = new Date();

    “Date: ” + d.getDate() + “/” + (d.getMonth()+1) + “/” + d.getFullYear();

    Also here’s a version which pads the zeros.

    d = new Date();

    function padZeros(n){

    if(n <= 9){

    return “0” + n;

    }

    return n

    }

    “Date: ” + padZeros(d.getDate()) + “/” + padZeros(d.getMonth()+1) + “/” + d.getFullYear();

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy