briannesbitt / Carbon

A simple PHP API extension for DateTime.
https://carbon.nesbot.com/
MIT License
16.54k stars 1.28k forks source link

Timezone createFromTimestamp error? #83

Closed philsabourin closed 10 years ago

philsabourin commented 10 years ago

With the following code:

echo 'Time in Regina (now): '.\Carbon\Carbon::now('America/Regina');

echo $test = \Carbon\Carbon::create(2014, 8, 2, 0, 0, 0);

echo 'Time in Winnipeg : '.\Carbon\Carbon::createFromTimestamp($test->timestamp, 'America/Winnipeg');

echo 'Time in Regina : '.\Carbon\Carbon::createFromTimestamp($test->timestamp, 'America/Regina');

I'm getting...

Time in Winnipeg : 2014-08-01 23:00:00 Time in Regina : 2014-08-01 22:00:00

Thanks

briannesbitt commented 10 years ago

Regina is in Saskatchewan and they don't change their clocks for DST. http://en.wikipedia.org/wiki/Time_in_Saskatchewan

philsabourin commented 10 years ago

Thanks!

Forgot about that one.