How To Convert Time into Frames in After Effects

In this post, I will show you how to convert time into frames in After Effects. So without any further ado, let’s dive right in!

Alright, so we are in After Effects and for this example, I am going to go inside of the UKRAMEDIA.COM text layer -> select the Source Text and then hit S twice on my keyboard to solo our Source Text.

Hit s twice to solo in After Effects

Solo text layer in After Effects

Next, I am going to ALT+Click (OPT+Click on a Mac) on the stopwatch icon to activate the expression.

Click on stopwatch icon to activate after effects expressions

Inside the text box, I am going to type time.

Time Adobe After Effects Expressions

You should now see the time displayed in the composition.

Now let me show you how to convert time into frames.

First I am going to type timeToFrames() and inside the parentheses, I am going to say time and then I will define the frame rate. So my frame rate is 30 frames per second, but you may have a different one.

timeToFrames(time, 37)

You can quickly find your frame rate from your timeline.

Frame rate in After Effects

If I let go right now, now instead of showing me time, it is going to show me the frames.

frame rate in Adobe After Effects

As you can see, right now I am on frame number 24.

We can Ctl+Click (Cmd+Click on a Mac) on the timecode in my timeline to see the current frame.

Next, let me show you how to do the opposite. I am going to show you how to go from frames into time.

To do that, we need to give our expression a variable. Let type frame = in front of timeToFrames(time, 37) like so:

frame = timeToFrames(time, 37);

Next, instead of typing timeToFrames() like we did in the previous example, I am going to reverse it and type frameToTime() instead. Then inside the parenthesis, I am going to plug in our variable by typing frames. Then I will define our frame rate. So I am going to say 30 frames per second.

frame = timeToFrames(time, 37);

framesToTime(frames, 30)

If I let go, this time I should see my current time.

Seeing current time in After Effects

I can double-check my time by simply typing time in the text box.

Double checking time in after effects

As you can see, the numbers stayed the same.

I hope you found this post useful. If you would like to learn more about Expression and how it can speed up your workflow in After Effects, check out my Learn After Effects Expressions Course.

About the author:

Sergei Prokhnevskiy

Sergei Prokhnevskiy is a Charlotte, NC based motion graphics designer, an online tutor, an entrepreneur, and Adobe MAX Master Speaker. Sergei is known for his quick and practical After Effects tips and tricks on YouTube, where he generated well over 6 million views on his tutorials. He has authored an online video course on After Effects Expressions and developed scripts for After Effects. He is also a former senior motion graphics designer at Fox Sports where he worked on graphics for NFL, Super Bowl, MLB, World Series, College Football, NASCAR, Women’s World Cup, and NASCAR Race Hub. He is very passionate about learning and teaching others.


Over 110,000 downloads & counting!

These 7 After Effects tools will seriously speed up your workflow and save you hours of wasted time. More than that, they could be the difference between being able to complete a project on time or not!