florianv / swap

:currency_exchange: Currency exchange rates library

Home Page:https://florianv.github.io/swap/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getDate() format in hour

carbonvader opened this issue · comments

Hi all,

Can not $rate->getDate() be formatted to Y-m-d H:i? I needed the hour as well and tried
$rate->getDate()->format('Y-m-d H:i') However it just returns 00:00.

Here is the dump of $rate->getDate()

object(DateTime)#6244 (3) {
  ["date"]=>
  string(26) "2018-04-09 00:00:00.000000"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(9) "ETC/GMT-3"
  }

Thanks for your effort on this package @florianv.

@carbonvader Hey! If you cannot retrieve the time, it's because it's probably not supported by the service you use (daily updates)