-1

I would like to get a posts from my FB group but I have a problem with timezone. For example, one post was sent at 22:01 (in Poland). When I try to get this time by PHP, I get: 2016-04-03T20:01:00+0000 How to get this time post as timezone - Europe/Warsaw (that should be 22:01).

Now I get this time by that way:

strtotime($value['created_time'])

And this return: 20:01. How to solve this problem? Thanks.

Majkson
  • 227
  • 4
  • 15

1 Answers1

1

Just change timezone:

$dt = new DateTime('2016-04-03T20:01:00+0000');
$dt->setTimezone(new DateTimezone('Europe/Warsaw'));
echo $dt->format('c');

demo

Glavić
  • 42,781
  • 13
  • 77
  • 107