Skip to content

currentTimestamp β€” GTM Variable Template for Date

VARIABLES β€Ί DATE
currentTimestamp CORE Date
Direct (.tpl)

Returns the current timestamp in milliseconds since epoch.


Date Formatting

Format and transform date values into human-readable or machine-readable strings.

Date & Time

Calculate durations, differences, and time-based operations on date values.


Returns current timestamp
OUTPUT
""

This is what you'll see when you open this variable in Google Tag Manager.

Read-only Preview
currentTimestamp
This function takes no parameters.


πŸ“œ View Implementation Code
/**
* Returns the current timestamp in milliseconds.
*
*
* @returns {number} The current timestamp in milliseconds since epoch.
*
* @framework ggLowCodeGTMKit
*/
const getTimestampMillis = require('getTimestampMillis');
// ===============================================================================
// currentTimestamp - Direct mode
// ===============================================================================
return getTimestampMillis();
πŸ§ͺ View Test Scenarios (1 tests)
βœ… '[example] Returns current timestamp'