Activity › Forums › Adobe After Effects Expressions › Current Date
-
Current Date
Posted by Anthony Dupsta on August 11, 2010 at 6:53 pmIs there a script that gives you the current date. Any format, as long as the date is shown. It would be useful for my burn-in to display this information on screen.
Thank you
Daniel Buckland replied 3 years, 2 months ago 5 Members · 5 Replies -
5 Replies
-
Dan Ebberts
August 11, 2010 at 8:12 pmThis 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 pmDan,
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 pmHoly 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 amThanks 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 amIf 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();
Reply to this Discussion! Login or Sign Up