Skip to content

Instantly share code, notes, and snippets.

@robozavri
Created June 20, 2018 07:58
Show Gist options
  • Save robozavri/1c55830366ca894ab17635df7fc979b4 to your computer and use it in GitHub Desktop.
Save robozavri/1c55830366ca894ab17635df7fc979b4 to your computer and use it in GitHub Desktop.
google matric duration distance converter, converts distans value and duration value
/*
seconds:
12879
6262
metrs:
130229
*/
print 12879 / 60;
echo '<br>Hours : '. floor(12879 / 3600);
echo '<br>Minits'. floor(12879 / 60 % 60);
echo '<br>';
print 6262 / 60;
echo '<br>Hours : '. floor(6262 / 3600);
echo '<br>Minits'. floor(6262 / 60 % 60);
echo '<hr>';
echo gmdate("H:i:s", 12879).'<br>';
echo gmdate("H:i:s", 6262).'<br>';
echo '<hr>';
print 6262 / 60;
echo '<br>Hours : '. floor(6262 / 3600);
echo '<br>Minits'. floor(6262 / 60 % 60);
echo '<hr>';
echo 'km:'.floor(130229 / 1000);
echo '<br>M: '. floor(130229 % 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment