Clanbite Since 1.6.3

clanbite_human_time_ago( int $timestamp, ?int $now = null ): string

A timestamp as relative wording ("5 minutes ago"), the same everywhere Clanbite shows one.

Feeds, forums and notifications call this instead of formatting their own, so a site (or a translation) changes the wording in one place with the clanbite_human_time_ago filter.

Parameters

$timestamp (int) Required

Unix timestamp of the moment.

$now (int|null) Optional

Unix timestamp to measure from. Default: now (time()). Pass current_time( 'timestamp' ) when $timestamp was built from a site-local date.

Default: null

Returns

string Text such as "5 minutes ago".

Defined in inc/functions-time.php

Changelog

VersionDescription
1.6.3Introduced.