Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array to string conversion #6

Open
MacFlurry opened this issue Jun 17, 2017 · 1 comment
Open

Array to string conversion #6

MacFlurry opened this issue Jun 17, 2017 · 1 comment

Comments

@MacFlurry
Copy link

MacFlurry commented Jun 17, 2017

Hello

this is a simple code trying to convert s to day / hour / min
Ps :I'm using php 7

<?php
include("Convertor.php");

$simpleConvertor = new Convertor(1209867, "s");
var_dump($simpleConvertor->to(array('day', 'hr', 'min')));

this is the result:

array(3) {
  ["day"]=>
  float(14.003090277778)
  ["hr"]=>
  float(336.07416666667)
  ["min"]=>
  float(40328.9)
}

would be good to get the correct convert seconds to day(if possible ) / hours / min

like :

14 days 4 minutes 27 seconds

Thanks

@TomLorenzi
Copy link
Contributor

Your result is the intended one, you should use a date conversion package for that, not a unit converion library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants