mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-19 06:34:03 +09:00
Merge branch 'master' into feature/refresh-auth
This commit is contained in:
@@ -33,9 +33,13 @@ abstract class WPStrava_SOM {
|
||||
* Create a time string of hours:minutes:seconds from just seconds.
|
||||
*
|
||||
* @return string Time formatted as 'H:i:s'.
|
||||
* @see https://stackoverflow.com/a/20870843/2146022
|
||||
*/
|
||||
public function time( $seconds ) {
|
||||
return date( 'H:i:s', mktime( 0, 0, $seconds ) );
|
||||
$zero = new DateTime( '@0' );
|
||||
$offset = new DateTime( "@{$seconds}" );
|
||||
$diff = $zero->diff( $offset );
|
||||
return sprintf( '%02d:%02d:%02d', $diff->days * 24 + $diff->h, $diff->i, $diff->s );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user