title: AWS API Gateway - How do I get the date/timestamp/epoch in a body mapping template?
body: <p>I need to include the request time in the body mapping template for an API Gateway method. Is there a date/time variable or function? I couldn't find anything in the <a href="http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#util-template-reference" rel="noreferrer">template reference</a>.</p>
  
  <p>Example body mapping template:</p>
  
  <pre><code>Action=SendMessage&amp;MessageBody=$util.urlEncode("{""timestamp"":""TIMESTAMP_HERE"",""body-json"":$input.json('$'),""params"":""$input.params()""}")
  </code></pre>