Is the result of strtotime() changed based on the timezone?

php

Solution

From the documentation:

Each parameter of this function uses the default time zone unless a time zone is specified in that parameter. Be careful not to use different time zones in each parameter unless that is intended. See date_default_timezone_get() on the various ways to define the default time zone.

So yes, it is based on the time zone unless you specify a specific timezone in `$datetime`

Problem

I used `strtotime($datetime)` in PHP to convert textual datetime description into Unix timestamp (see code below). ``` $datetime = '2012-04-17 00:00:00'; $timestamp = strtotime($datetime); ``` However, the result of `$timestamp` in Time zone (London) was 1334617200 and in Time zone (Beijing) it was 1334620800. Can anyone explain me why this happened? Is the result of `strtotime()` changed based on the timezone? Thanks in advance!

Original source

Related problems