# Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Changing time from seconds to frames in expression

• # Changing time from seconds to frames in expression

Darby Edelen updated 1 year ago 3 Members · 4 Posts
• ### Obed Ampong

April 6, 2020 at 1:29 pm

Hello,

Please, the expression below has the time duration in seconds however I would like to change it to the number of frames.

Regards,

Obed

`function easeInOutCubic(t, tMin, tMax, value1, value2){ b = value1; c = value2-b; d = tMax-tMin; t = tMin &lt; tMax ? thisLayer.linear(t,tMin,tMax,0,d) : thisLayer.linear(t,tMin,tMax,d,0);`

` t /= d/2; if (t &lt;1) return c/2*Math.pow(t,3) + b; t -= 2; return c/2*(Math.pow(t,3) + 2) + b; }`

`duration = 1;`

`start=[-2000,540,-2000]; destination = [960,540,0]; exit = [2000,540,-3000];`

`middle = (inPoint+outPoint)/2;`

`v = time &lt; middle ? easeInOutCubic(time,inPoint,inPoint+duration,start,destination) : easeInOutCubic(time,outPoint-duration,outPoint,destination,exit); `

• ### Andrei Popa

April 6, 2020 at 5:06 pm

Change the declaration of duration variable. That first number is the number of frames.

`duration = 30 * thisComp.frameDuration;`

Andrei
My Envato portfolio.

• ### Obed Ampong

April 7, 2020 at 8:55 am

Hello Andrei,

Thank you very much.

Regards

Obed

• ### Darby Edelen

April 7, 2020 at 6:27 pm

There are also expressions to convert a value in seconds to frames and vice versa:

`timeToFrames(seconds); framesToTime(frames);`

Darby Edelen

Viewing 1 - 4 of 4 posts