Skip to content

[feature] Jinja2 filter for converting Unix timestamps into human-readable datetime in notifications  #3641

@Frew777

Description

@Frew777

Version and OS
0.45.x (Docker)


Is your feature request related to a problem? Please describe.
Some monitored pages return timestamps in Unix format (e.g. 1759188682) rather than human-readable dates.
When the notification uses tokens like {{diff}}, {{triggered_text}}, or {{current_snapshot}}, the timestamp is included as a raw number, which makes notifications difficult to read.
Currently there is no way to convert Unix timestamps to formatted datetime values using Jinja2 inside changedetection.io.


Describe the solution you'd like
A built-in Jinja2 filter to convert Unix timestamps into readable dates. Example:

{{ triggered_text | unixtime }}

Or with formatting support:

{{ triggered_text | unixtime("%d.%m.%Y %H:%M:%S") }}

This would allow timestamp conversion directly in notification templates without requiring external processing.


Describe the use-case and give concrete real-world examples
Many API-style pages and structured responses expose timestamps like:

last_battle_at: 1759188682

Expected output in a notification:

Last battle: 30.09.2025 02:31

Right now achieving this requires a custom webhook or external automation simply to convert the value, which is excessive for such a basic transformation.


Additional context

  • Jinja2 currently has no timestamp conversion
  • Existing filters (tojson, urlencode, etc) do not help
  • External middleware (Node-RED, n8n, proxy scripts) works but is overkill for this use case
  • A small built-in helper would greatly improve readability for timestamp-based content
  • Even a documented workaround would be helpful if a filter cannot be implemented

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions