Obtaining Epoch Server Time From A Policy

book

Article ID: 14617

calendar_today

Updated On:

Products

STARTER PACK-7 CA Rapid App Security CA API Gateway

Issue/Introduction



How to obtain the Epoch Server time from a policy

Environment

CA API GATEWAY

Resolution

Unix epoch time (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT).  This can be obtained from the API Gateway time context variables and used in assertions. 

The current API Gateway time can be obtained via:

${gateway.time}

The current Unix epoch time can be obtained via:

${gateway.time.seconds}

Other timestamp suffixes can be used to obtain other information; for example:

${gateway.time.millis}

More information on timestamp suffixes can be found via the Policy Manager User Manual and/or Help system, by searching for "Date and Time Variables".