* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Locale\Stub\DateFormat; /** * Parser and formatter for date formats * * @author Igor Wiedler */ class TimeZoneTransformer extends Transformer { public function format(\DateTime $dateTime, $length) { return $dateTime->format('\G\M\TP'); } public function getReverseMatchingRegExp($length) { return 'GMT[+-]\d{2}:\d{2}'; } public function extractDateOptions($matched, $length) { return array( 'timezone' => (int) $matched, ); } }