Less than 1 minute
seconds
Convert a string interval to seconds.
public seconds({Array})
This function can be used to convert a string interval such as '1 week' into seconds. Currently supported intervals are seconds, minutes, hours, days and weeks. Months are not supported because some crazy crackpot decided to make them all different lengths, so without knowing which month we're talking about, converting them to seconds is impossible.
Multiple interval support is also possible. Intervals can be separated with a comma (,) or the word 'and', for example:
$foo = seconds('1 week, 2 days');
$bar = seconds('1 week and 2 days');
Both of these function calls will yeild the same result.
Parameters
Parameter | Type | Description |
---|---|---|
$interval | string | The string interval to convert to seconds |
Generated by Hazaar API Doc Generator