This KB article outlines how to obtain the Epoch Server time from a policy.
All supported versions of the API Gateway
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".