1 | <?php |
||
10 | class DateTimeToStringValueConverter |
||
11 | { |
||
12 | /** |
||
13 | * Date time format |
||
14 | * |
||
15 | * @var string |
||
16 | * @see http://php.net/manual/en/datetime.createfromformat.php |
||
17 | */ |
||
18 | protected $outputFormat; |
||
19 | |||
20 | /** |
||
21 | * @param string $outputFormat |
||
22 | */ |
||
23 | 2 | public function __construct($outputFormat = 'Y-m-d H:i:s') |
|
27 | |||
28 | /** |
||
29 | * Convert string to date time object |
||
30 | * using specified format |
||
31 | * |
||
32 | * @param mixed $input |
||
33 | * @return \DateTime|string |
||
34 | * @throws UnexpectedValueException |
||
35 | */ |
||
36 | 2 | public function convert($input) |
|
48 | } |
||
49 |