Custom Pebble filters
Epoch Time Stamp
You can use the following Pebble filters to return the epoch time stamp for Now or a given date string:
Epoch time stamp for Now:
{{ now() | epoch }} => default UTC timezone and in seconds
{{ now() | epoch(inMillis=true) }} => default UTC timezone and in milliseconds
Example:
{{ now() | epoch }} -> 1667471488
{{ now() | epoch(inMillis=true) }} -> 1667471522829
Epoch Time Stamp for a specific date:
{{ '2017-10-19 16:18:03.779' | epoch(format='yyyy-MM-dd HH:mm:ss.SSS', inMillis=true) }} => custom format and in milliseconds
{{ '2017-10-19 16:18:03.779' | epoch(format='yyyy-MM-dd HH:mm:ss.SSS', inMillis=true, timeZone='America/Phoenix') }} => custom format with timezone and in milliseconds
Example:
{{ '2017-10-19 16:18:03.779' | epoch(format='yyyy-MM-dd HH:mm:ss.SSS', inMillis=true) }} -> 1508429883779
{{ '2017-10-19 16:18:03.779' | epoch(format='yyyy-MM-dd HH:mm:ss.SSS', inMillis=true, timeZone='America/Phoenix') }} -> 1508455083779