public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/functions.php
/**
 * Convert a time in seconds to a human label.
 *
 * @since 1.0.0
 *
 * @param integer $seconds The time in seconds.
 *
 * @return string The time in hours, minutes and seconds.
 */
Convert a time in seconds to a human label.

@param integer $seconds The time in seconds.

@return string The time in hours, minutes and seconds.
Convert a time in seconds to a human label . @param integer $seconds The time in seconds . @return string The time in hours minutes and seconds .
function WPCW_time_convertSecondsToHumanLabel( $seconds ) {
	$lbl_seconds = 0;
	$lbl_minutes = 0;
	$lbl_hours   = 0;
	if ( $seconds > 0 ) {
		$lbl_hours   = floor( $seconds / 3600 );
		$lbl_minutes = ( $seconds / 60 ) % 60;
		$lbl_seconds = $seconds % 60;
	}
	$labelToReturn = sprintf( '%d %s %d %s',
		$lbl_minutes, __( 'mins', 'wp-courseware' ),
		$lbl_seconds, __( 'secs', 'wp-courseware' )
	);
	if ( $lbl_hours > 0 ) {
		$labelToReturn = sprintf( '%d %s ', $lbl_hours, __( 'hrs', 'wp-courseware' ) ) . $labelToReturn;
	}
	return $labelToReturn;
}
function WPCW_time_convertSecondsToHumanLabel ( $ seconds ) { $ lbl_seconds = 0 ; $ lbl_minutes = 0 ; $ lbl_hours = 0 ; if ( $ seconds > 0 ) { $ lbl_hours = floor ( $ seconds / 3600 ) ; $ lbl_minutes = ( $ seconds / 60 ) % 60 ; $ lbl_seconds = $ seconds % 60 ; } $ labelToReturn = sprintf ( '%d %s %d %s' , $ lbl_minutes , __ ( 'mins' , 'wp-courseware' ) , $ lbl_seconds , __ ( 'secs' , 'wp-courseware' ) ) ; if ( $ lbl_hours > 0 ) { $ labelToReturn = sprintf ( '%d %s ' , $ lbl_hours , __ ( 'hrs' , 'wp-courseware' ) ) . $ labelToReturn ; } return $ labelToReturn ; }
Convert a time in seconds to a human label.
Convert a time in seconds to a human label .
// Calculate everything and break it down. // Start of with minutes and seconds - always use these. // If we have hours too, then prepend.