bp_core_time_diff( array $args = array() )

Calculate the human time difference between two dates.


Description Description

Based on function created by Dunstan Orchard – http://1976design.com


Parameters Parameters

$args

(Optional) An array of arguments. All arguments are technically optional.

  • 'older_date'
    (int|string) An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'.
  • 'newer_date'
    (int|string) An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'.
  • 'time_chunks'
    (int) The number of time chunks to get (1 or 2).

Default value: array()


Top ↑

Return Return

(null|array|false) Null if there's no time diff. An array containing 1 or 2 chunks of human time. False if travelling into the future.


Top ↑

Source Source

File: bp-core/bp-core-functions.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.