Clanbite Since 1.6.3
clanbite_human_time_ago( int $timestamp, ?int $now = null ): stringA 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) RequiredUnix timestamp of the moment.
$now(int|null) OptionalUnix timestamp to measure from. Default: now (
time()). Passcurrent_time( 'timestamp' )when$timestampwas built from a site-local date.Default:
null
Returns
string Text such as "5 minutes ago".
Defined in inc/functions-time.php
Changelog
| Version | Description |
|---|---|
| 1.6.3 | Introduced. |