wp_human_time_diff()

Twig function of the framework; its result is escaped like any value.

{{ wp_human_time_diff(from, to = 0) }}

The difference between two Unix timestamps in words, e.g. "5 minutes", as returned by human_time_diff(), as text. Without a second timestamp it measures to the current time; a block with #[Cache] cannot do that: the call throws an error there.

{{ wp_human_time_diff(attrs.start, attrs.end) }}
ParameterTypeDefaultDescription
fromintrequiredUnix timestamp to start from.
toint0Unix timestamp to end at; 0 for now.

Returns string