Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 626 Bytes

converter.md

File metadata and controls

22 lines (17 loc) · 626 Bytes

Timezone Converter

Sets the date of a user time zone

// create new instance
use GpsLab\Bundle\DateBundle\TimeZone\Converter;
$converter = new Converter($tz_keeper);

// you cat get TimeZone keeper from DI
// $tz_keeper = $this->get('gpslab.date.tz.keeper');

// for simple get the converter from DI
$converter = $this->get('gpslab.date.tz.converter');

// convert value to \DateTime
$converter->getDateTime('2016-12-07 13:56:07');
$converter->getDateTime('now');
$converter->getDateTime('first day of this month');
$converter->getDateTime(1481108167); // Unix Timestamp for 2016-12-07 13:56:07