0

i make an API call for Podio, to get active space members. One of the fields that returns is last_seen_on, which is a DateTime Object.

When i print_r() it looks like:

DateTime Object
(
    [date] => 2013-11-02 22:47:09
    [timezone_type] => 3
    [timezone] => UTC
)

The issue is when I get the date or timezone_type or timezone by doing $object[date], or $object->date it throws an error.

Now i am not sure if this has something to do with php DateTime class, if so.. how do I use that object with that class?

random_user_name
  • 25,694
  • 7
  • 76
  • 115
Neta Meta
  • 4,001
  • 9
  • 42
  • 67

1 Answers1

1

As it's a datetime instance, you can return the date with the following. Or however you want, in accordance to the documentation.

echo $object->format('Y-m-d H:i:s');

Link to documentation

Ben Fortune
  • 31,623
  • 10
  • 79
  • 80
  • that's also what i suspected and i tried that but did not work before - maybe i did something wrong will try again. Yap .. you are correct – Neta Meta Nov 19 '13 at 14:58