Get a string of current time since epoch (seconds) in nginx
06:31 22 Sep 2018

In nginx configuration file, what is the best way to get a variable containing string representation of current time in seconds since epoch? Conceptually I want something like this:

$timestamp = ;
add_header Time $timestamp;

As requested by a moderator, this is not a duplication of

Is there a way to get the current time in nginx?

as variables $date_gmt and $date_local do not provide seconds-since-epoch format.

nginx