Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Quiz_Legacy::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
-
(mixed) (Required) a time (string or timestamp)
- $time2
-
(mixed) (Required) a time (string or timestamp)
- $precision
-
(integer) (Optional) precision
Default value: 2
Return Return
(string) time difference
Source Source
File: includes/class.llms.quiz.legacy.php
Expand full source code Collapse full source code View on GitHub