first commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
function d($value, $exit = 0)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
print_r($value);
|
||||
} else if (is_object($value)) {
|
||||
var_dump($value);
|
||||
} else {
|
||||
echo $value;
|
||||
}
|
||||
echo "<br/>";
|
||||
if ($exit) {
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
function convertUtcToLocal($datetime, $timezone = '', $format = 'Y-m-d H:i:s')
|
||||
{
|
||||
if (!empty($datetime) && !empty($timezone)) {
|
||||
$datetime = date($format, strtotime($datetime));
|
||||
$utc_date = DateTime::createFromFormat(
|
||||
$format,
|
||||
$datetime,
|
||||
new DateTimeZone('UTC')
|
||||
);
|
||||
if ($utc_date) {
|
||||
$utc_date->setTimeZone(new DateTimeZone($timezone));
|
||||
return $utc_date->format($format);
|
||||
}
|
||||
}
|
||||
return $datetime;
|
||||
}
|
||||
Reference in New Issue
Block a user