$date = new DateTime('2017-02-09T00:20:00+05:00');
var_dump($date);
object(DateTime)[367]
public 'date' => string '2017-02-09 00:20:00.000000' (length=26)
public 'timezone_type' => int 1
public 'timezone' => string '+05:00' (length=6)
$date->setTimezone(new DateTimeZone('Europe/Moscow'));
var_dump($date);
object(DateTime)[367]
public 'date' => string '2017-02-08 22:20:00.000000' (length=26)
public 'timezone_type' => int 3
public 'timezone' => string 'Europe/Moscow' (length=13)
$html = "<div class='form-group field-users-created_at required'>";
foreach ($items as $item) {
$html .= Html::beginTag('label', $labelOptions) .
$item .
Html::Tag('input','',$options).
"<span></span>".
Html::endTag('label');
}
$html .= "<span class='help-block'></span></div>";
return $html;
$currentTime = new DateTime('6:42');
foreach ($array as $key => $value) {
if ( ($currentTime > new DateTime($value['start'])) && ($currentTime < new DateTime($value['end'])) ) {
echo $value['text'] . '<br>';
break;
}
}