PHP - 将时间与毫秒进行比较
PHP - Compare time with milliseconds
如何在 PHP 中将两次与毫秒进行比较?也就是说,我有这样的时候:
- 00:38.673
- 00:38.652
试试这个:
// Parses the inputed string
sscanf('00:38.673', "%d:%d.%d", $minutes, $seconds, $miliseconds);
// Convert it to miliseconds
$mseconds = $seconds * 1000 + $minutes * 60 * 1000 + $miliseconds;
如何在 PHP 中将两次与毫秒进行比较?也就是说,我有这样的时候:
- 00:38.673
- 00:38.652
试试这个:
// Parses the inputed string
sscanf('00:38.673', "%d:%d.%d", $minutes, $seconds, $miliseconds);
// Convert it to miliseconds
$mseconds = $seconds * 1000 + $minutes * 60 * 1000 + $miliseconds;