Hello,
I upgraded my prodject's Carbon version from 1.21 to 2.23.1 and I encountered an issue with the following code:
echo Carbon::createFromTimestamp('468370800', '+0100');
Carbon version: 2.23.1
PHP version: 7.2
I expected to get:
1984-11-04 00:00:00
But I actually get:
[InvalidArgumentException]
Absolute timezone offset cannot be greater than 100.
Thanks!
In fact this timezone was wrong automatically fixed before 1.22: '+0100' was converted to '+01:00', but it's guessing and it can be dangerous, as you can also pass '+1' that also gives you '+01:00'
The problem was than 100 does not match either a number of minutes nor a name, so since 1.22, '+0100' became invalid to avoid bugs on unexpected timezones.
I will check if we can parse it with no risk. Meanwhile, you can simply use: '+01:00'
Or if your timezone is dynamic: substr($tz, 0, -2).':'.substr($tz, -2)
It can be fixed with no regression so it will be supported again in 2.25.0.
Fixed, you can test it on the dev-master version.
It works!