llms_get_date_diff( mixed $time1, mixed $time2, integer $precision = 2 )

Get human readable time difference between 2 dates


Description Description

Return difference between 2 dates in year, month, hour, minute or second The $precision caps the number of time units used: for instance if $time1 – $time2 = 3 days, 4 hours, 12 minutes, 5 seconds

  • with precision = 1 : 3 days
  • with precision = 2 : 3 days, 4 hours
  • with precision = 3 : 3 days, 4 hours, 12 minutes.

Parameters Parameters

$time1

(Required) A time (string or timestamp).

$time2

(Required) A time (string or timestamp).

$precision

(Optional) precision. Default is 2.

Default value: 2


Top ↑

Return Return

(string) time difference


Top ↑

Source Source

File: includes/llms.functions.core.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
3.24.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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