Torann / laravel-currency

This provides Laravel with currency functions such as currency formatting and conversion using up-to-date exchange rates.
http://lyften.com/projects/laravel-currency
BSD 2-Clause "Simplified" License
390 stars 137 forks source link

Timestamp error when running update #90

Closed EdnaldoNeimeg closed 6 years ago

EdnaldoNeimeg commented 6 years ago

When I run php artisan currency:update I receive the following error:

[Exception]                                                                   
  DateTime::__construct(): Failed to parse time string (191232025916) at posit  
  ion 11 (6): Unexpected character   

I solved my problem by editing /src/Console/Update.php file.

Replace this line

$timestamp = new DateTime(strtotime($content->timestamp));

By this

$timestamp = new DateTime();
$timestamp->setTimestamp($content->timestamp);

I know that my solution is not the best since it'll be overwriten whhen I run composer update

Torann commented 6 years ago

Just released a patch for this