31 lines
467 B
PHP
31 lines
467 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
class Helpers
|
|
{
|
|
/**
|
|
* Create a new class instance.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//
|
|
}
|
|
|
|
public static function leadingZero($number)
|
|
{
|
|
return $number < 10 ? '0'.$number : $number;
|
|
}
|
|
|
|
public static function secondsToTimecode(float $seconds){
|
|
|
|
$hours = floor($seconds / 3600);
|
|
$minutes = floor(($seconds % 3600) / 60);
|
|
|
|
return "${hours}:${minutes}";
|
|
|
|
}
|
|
|
|
|
|
}
|