Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
The SVGAnimationElement method getCurrentTime() returns a float representing the current time in seconds relative to time zero for the given time container.
Time zero refers to the moment when the time container begins its timeline. It acts as the starting reference point for all animations within that container.
A time container is an element or context that defines a local timeline for one or more animations. Animations inside the time container are measured relative to its timeline. If a time container is delayed, paused, or manipulated, all animations within it adjust accordingly.
None (undefined).
A float.
This example demonstrates how the getCurrentTime() method retrieves the time elapsed since the time container's time zero.
The animation starts at time zero = 0 and runs indefinitely, and the getCurrentTime() value increments continuously within the context of the time container.
| SVG Animations Level 2 # __svg__SVGAnimationElement__getCurrentTime |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jan 23, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.