$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;
}
}
<select class="form-control" name="pos">
<option value="Choose one" selected>
<?php
for($i=0;$i<count($pos);$i++){
echo "<option name='$id'>".$pos[$i]['title_pos']."</option>";
}
?>
</select>
<label for="type">Payment type:</label>
<select class="form-control" name="type">
<option value="Choose one" selected>
<?php
for($i=0;$i<count($types);$i++){
echo "<option name='$id'>".$types[$i]['title_type']."</option>";
}
?>
</select><select class="form-control" name="pos">
<option value="Choose one" selected>
<?php foreach($positions as $position): ?>
<option value="<?= $position['id'] ?>"><?= $position['title_pos'] ?></option>
<?php endforeach; ?>
</select>
<label for="type">Payment type:</label>
<select class="form-control" name="type">
<option value="Choose one" selected>
<?php foreach($types as $type): ?>
<option value="<?= $type['id'] ?>"><?= $type['title_type'] ?></option>
<?php endforeach; ?>
</select>
<?php if ($counter % 4 == 0) { ?>
<div class="clearfix"></div>
<?php } ?>
<?php } ?>