Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Date object return incorrect dates Extendscript

  • Date object return incorrect dates Extendscript

    Posted by Miguel De mendoza on September 4, 2016 at 7:37 pm

    I have this code:

    var date = new Date();
    var day=date.getDay() ;
    var month = date.getMonth();
    var year = date.getYear();
    var curDate = day + "_" + month + "_" + year;

    But curDate is returning me this: “2_6_116”. Is a way to fix this?

    Miguel De mendoza replied 9 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 4, 2016 at 8:27 pm

    Try this:

    date = new Date(Date(0));
    day = date.getDate();
    month = date.getMonth() + 1;
    year = date.getFullYear()%100;
    curDate = day + “_” + month + “_” + year;

    Dan

  • Miguel De mendoza

    September 5, 2016 at 8:04 am

    Thanks Dan. It works!

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