12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- /*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
- *
- * 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 <igor@wiedler.ch>
- */
- 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,
- );
- }
- }
|