. */ /* */ /**********************************************************************************/ namespace Thelia\Tools; use Thelia\Model\Lang; /** * Created by JetBrains PhpStorm. * Date: 8/19/13 * Time: 3:24 PM * * Helper for translations * * @package I18n * @author Guillaume MOREL * */ class I18n { /** * Create a \DateTime from a date picker form input * The date format is the same as the one from the current User Session * Ex : $lang = $session->getLang() * * @param Lang $lang Object containing date format * @param string $date String to convert * * @return \DateTime */ public function getDateTimeFromForm(Lang $lang, $date) { $currentDateFormat = $lang->getDateFormat(); return \DateTime::createFromFormat($currentDateFormat, $date); } }