Post

1 follower Follow
2
Avatar

Get start_time of date field

We tried to get a 'date' field in an item using PodioItem::get(). When we checked the output (below) all the date related values are there in the date field object.

OUTPUT

[values] => Array
(
[0] => Array
(
[start_date_utc] => 2015-11-16
[end] => 2015-11-26 06:30:00
[end_date] => 2015-11-26
[end_date_utc] => 2015-11-26
[start_time_utc] => 00:00:00
[start_time] => 05:30:00
[start_date] => 2015-11-16
[start] => 2015-11-16 05:30:00
[end_time] => 06:30:00
[end_time_utc] => 01:00:00
[end_utc] => 2015-11-26 01:00:00
[start_utc] => 2015-11-16 00:00:00
)

            )

But when we tried to get that particular date object field, it is not returning the output as we expected (below).

field->values OUTPUT

Array
(
[start] => DateTime Object
(
[date] => 2015-11-16 00:00:00
[timezone_type] => 3
[timezone] => UTC
)

[end] => DateTime Object
    (
        [date] => 2015-11-26 01:00:00
        [timezone_type] => 3
        [timezone] => UTC
    )

)

How to retrieve all date and time-related data from a field (we already tried this: http://podio.github.io/podio-php/fields/#date-field)?

Nivin V Joseph

Please sign in to leave a comment.