Copy link to clipboard
Copied
I need to show the progress of time from a given point as in December 05, 1918 to November 15, 1923 in days, months, years.
The days would have to loop for odd and even months as in 01 to 31 followed by 01 to 30, etc. And the months would have to loop from 01 to 12 and again year by year as the years count up. The first keyframe would be 1918-12-05 and last keyframe 1923-11-15 as the numbers climb rapidly. I can't figure out what slider and expression I need in order to do this.
Thank you in advance for any help or suggestions with this.
Copy link to clipboard
Copied
From Dan Ebberts:
startDate = "Dec 5 1918";
endDate = "Nov 15 1923";
rate = 200; // counts per second
d1 = new Date(startDate);
d2 = new Date(endDate);
msPerDay = 24*60*60*1000;
t = Math.floor((time-inPoint)*rate);
ms = Math.min(d1.getTime() + t*msPerDay,d2);
d = new Date(ms);
dy = "" + d.getDate();
mo = "" + (d.getMonth()+1);
yr = "" + d.getFullYear();
if (dy.length < 2) dy = "0" + dy;
if (mo.length < 2) mo = "0" + mo;
yr + "-" + mo + "-" + dy
You have to do the math to figure out how many days that is then set the rate to the value that will give you an animation that lasts the right amount of time. 200 may be too fast, but then again 200 may be too slow.
Personally, I think this is going to look really bad. All of those changing numbers. I would use 3 instances of CC Cylinder and put 30 days on one of them, 12 months on another, and seven years on the other. Unless your timeline is hours long the days are going to be nothing but a blur anyway so there is no need to worry about 28 days in February or 31 in January. The months don't need to line up with the days if they are a blur. Then you could just keyframe the days to spin quickly, the months to spin a little slower so you could see them start to speed up and then come to a stop, and then set 7 keyframes for the dates. This would look like an odometer spinning and be very easy to set up.
If you really want numbers then set keyframes for 3 animation sliders, one for the year, one for the day and one for the month. Then start them changing and add some Pixel Motion Blur or CC Force Motion Blur to try and blend the text together as the days change. Trying to do this literally is not really a good design idea unless the animation is going to be going by so slowly that the average viewer can tell the if the days and months go out of sync.
If you want to try the CC cylinder idea it just takes 3 text layers in pre-comps with CC Cylinder applied to each, then lined up.
Copy link to clipboard
Copied
Hi Rick,
Thank you very much for taking the time to explain all this and for sharing that expression with me. It works great. But I see what you mean about the numbers changing so rapidly that it wouldn't end up looking that great. Thanks again for your help! 🙂
Copy link to clipboard
Copied
Try this Expression,, and don't forget to add Time slider,
monthnames=["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
Speed=effect("Time")("Slider");
date_1=new Date(1918,11,5); // watchout month 0= january, 11=:december !
milli_1=date_1.getTime();
date_2=new Date(1923,10,15);
milli_2=date_2.getTime();
t=linear(time,0,Speed,milli_1,milli_2);
date_3=new Date(t);
date_3.getFullYear() + "-" + monthnames[date_3.getMonth()] + "-" + date_3.getDate() ;
Project file:
https://www.dropbox.com/s/5nkqjd2qm0gl7zz/Expression-Time.aep?dl=0
Copy link to clipboard
Copied
Hi Oussk,
Thank you as well for your help too and for sharing that expression. Should I erase the grey part of your expression? ("watch out month...")
Was that a FYI to alert me? Or is that part of the expression. Sorry, I'm so new to this. Doing my best to get up to speed with expressions. Again thank you very much for your help! I haven't been able to get that expression working so it must be something I'm doing wrong or something I left out. I have the time slider, but I'm getting an error message from AE when I paste the expression.
Copy link to clipboard
Copied
thank you!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now