Obtaining Epoch Server Time From A Policy

Document ID : KB000014617
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

How to obtain the Epoch Server time from a policy

Environment:
CA API GATEWAY
Answer:

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".