Class DateFormatter
Date formatter.
<?php namespace ICanBoogie\CLDR; $datetime = '2013-11-05 21:22:23'; $formatter = new DateFormatter($repository->locales['en']); echo $formatter($datetime, 'full'); // Tuesday, November 5, 2013 echo $formatter($datetime, 'long'); // November 5, 2013 echo $formatter($datetime, 'medium'); // Nov 5, 2013 echo $formatter($datetime, 'short'); // 11/5/13 $formatter = new DateFormatter($repository->locales['fr']); echo $formatter($datetime, 'full'); // mardi 5 novembre 2013 echo $formatter($datetime, 'long'); // 5 novembre 2013 echo $formatter($datetime, 'medium'); // 5 nov. 2013 echo $formatter($datetime, 'short'); // 05/11/2013
- ICanBoogie\CLDR\DateTimeFormatter implements ICanBoogie\CLDR\Formatter uses ICanBoogie\Accessor\AccessorTrait (not available)
- ┗ ICanBoogie\CLDR\DateFormatter
Methods summary
Methods inherited from ICanBoogie\CLDR\DateTimeFormatter
__construct()
,
__invoke()
,
format()
,
get_calendar()
,
resolve_width()
,
tokenize()
Constants summary
Constants inherited from ICanBoogie\CLDR\DateTimeFormatter
WIDTH_FULL
,
WIDTH_LONG
,
WIDTH_MEDIUM
,
WIDTH_SHORT