本文整理汇总了PHP中gmt_to_local函数的典型用法代码示例。如果您正苦于以下问题:PHP gmt_to_local函数的具体用法?PHP gmt_to_local怎么用?PHP gmt_to_local使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gmt_to_local函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: human_gmt_to_human_local
function human_gmt_to_human_local($human_gmt, $time_zone = NULL)
{
if (!$time_zone) {
$time_zone = 'UTC';
}
return date('Y-m-d H:i:s', gmt_to_local(strtotime($human_gmt), $time_zone, TRUE)) . ($time_zone == 'UTC' ? ' (UTC)' : '');
}
开发者ID:istrwei,项目名称:P2P-Tube,代码行数:7,代码来源:MY_date_helper.php
示例2: current_time
function current_time($timezone, $daylight_saving)
{
$time = time();
$gmt = local_to_gmt($time);
$local = gmt_to_local($gmt, $timezone, $daylight_saving);
return standard_date("DATE_RFC822", $local);
}
开发者ID:gitanton,项目名称:cono-rest,代码行数:7,代码来源:MY_date_helper.php
示例3: local_time
function local_time($client_id, $time)
{
$CI =& get_instance();
$CI->load->model('client_model');
$client = $CI->client_model->GetClientDetails($client_id);
$timestamp = !is_numeric($time) ? strtotime($time) : $time;
$timestamp = $timestamp - date("Z");
$timezone = $client->gmt_offset;
$daylight_saving = date("I") == 1 ? TRUE : FALSE;
// format
$format = defined("_CONTROLPANEL") ? "M j, Y" : "c";
if (defined("_CONTROLPANEL") and strstr($time, ' ')) {
$format = 'M j, Y h:i a';
}
$formatted_date = date($format, gmt_to_local($timestamp, $timezone, $daylight_saving));
// if the date is null, we won't return it
// any date before May 29, 1988 is null
$is_null = $timestamp < 580881600 ? TRUE : FALSE;
if ($is_null === TRUE and defined("_CONTROLPANEL")) {
return 'N/A';
} elseif ($is_null === TRUE) {
return '0';
} else {
return $formatted_date;
}
}
开发者ID:carriercomm,项目名称:opengateway,代码行数:26,代码来源:local_time_helper.php
示例4: getTransRateByTime
function getTransRateByTime($productId)
{
$r = $this->getTargetListByProductId($productId);
$num = $r->num_rows();
$ret = array();
$nret = array();
foreach ($r->result() as $row) {
$transEvents = $this->getTransEventsIdByTargetId($row->tid);
$event_from = $transEvents["from"];
$event_to = $transEvents["to"];
$timezonestimestamp = gmt_to_local(local_to_gmt(), $this->config->item('timezones'));
$timezonestime = date('Y-m-d H:i:m', $timezonestimestamp);
$from_count = 0;
$to_count = 0;
for ($i = 29; $i >= 0; $i--) {
$dataStr = date('Y-m-d-H-i', strtotime("-{$i} minutes", strtotime($timezonestime)));
$from_size = $this->redis->get("razor_r_p_e_" . $productId . "_" . $event_from . "_" . $dataStr);
$from_count += $from_size;
$to_size = $this->redis->get("razor_r_p_e_" . $productId . "_" . $event_to . "_" . $dataStr);
$to_count += $to_size;
if ($from_count == 0) {
$rate = 0;
} else {
$rate = $to_count / $from_count;
}
}
$r = array('name' => $row->targetname, 'time' => '-' . $i . lang("v_rpt_realtime_minutes"), 'from_count' => $from_count, 'to_count' => $to_count, 'rate' => $rate, 'event_to' => $event_to);
if ($to_count == 0) {
continue;
}
array_push($ret, $r);
}
return $ret;
}
开发者ID:stdroom,项目名称:MKAnalytics,代码行数:34,代码来源:transratemodel.php
示例5: __construct
public function __construct()
{
parent::__construct();
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
$this->load->model('noise_model');
if ($this->auth->is_logged() == FALSE) {
$this->status_login = "not_login";
$this->key_activation = $this->generate_key(20);
} else {
$this->status_login = "logueado";
}
// LOAD LIBRARY SLUG
$config = array('table' => 'notion', 'id' => 'id_notion', 'field' => 'slug', 'title' => 'title', 'replacement' => 'dash');
$this->load->library('slug', $config);
## FECHA
date_default_timezone_set('UTC');
$timestamp = now();
$timezone = 'UM5';
$daylight_saving = false;
$now = gmt_to_local($timestamp, $timezone, $daylight_saving);
$datestring = "%Y-%m-%d %h:%i:%s";
$this->now = mdate($datestring, $now);
//$this->name_country = $this->country->ip_info('Visitor', 'Country');
//$this->code_country = $this->country->ip_info("Visitor", "Country Code");
$this->name_country = 'PERU';
$this->code_country = 'PE';
//$this->state = $this->country->ip_info('181.66.157.144', 'State');
}
开发者ID:NeuronsWork,项目名称:7tual,代码行数:29,代码来源:noise.php
示例6: anadir_contacto
public function anadir_contacto($data)
{
$timestamp = time();
$fecha = date("Y-m-d H:i:s");
$this->db->set('identificador', $data['identificador']);
$this->db->set('nombre', $data['nombre_completo']);
$this->db->set('correo', $data['email']);
$this->db->set('telefono', $data['telefono']);
$this->db->set('comentario', $data['comentario']);
$this->db->set('fecha', $fecha);
$this->db->set('id_servicio', $data['servicio']);
$this->db->set('id_origen', $data['origen']);
$this->db->set('unixtime', gmt_to_local($timestamp, $this->timezone, TRUE));
$this->db->set('ip', $data['ip']);
$this->db->set('navegador', $data['navegador']);
$this->db->set('microsite', $data['microsite']);
$this->db->set('trafico', $data['origin']);
$this->db->insert($this->contacto);
if ($this->db->affected_rows() > 0) {
return TRUE;
} else {
return FALSE;
}
$result->free_result();
}
开发者ID:estrategasdigitales,项目名称:Pijottonew,代码行数:25,代码来源:contacto_model.php
示例7: __construct
public function __construct()
{
parent::__construct();
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
$this->load->model('web_model');
if ($this->auth->is_logged() == FALSE) {
$this->status_login = "not_login";
$this->key_activation = $this->generate_key(20);
} else {
$this->status_login = "logueado";
}
/* Obtenemos la fecha actual */
date_default_timezone_set('UTC');
$timestamp = now();
$timezone = 'UM5';
$daylight_saving = FALSE;
$now = gmt_to_local($timestamp, $timezone, $daylight_saving);
$datestring = "%Y-%m-%d %h:%i:%s";
$this->now = mdate($datestring, $now);
//$this->name_country = $this->country->ip_info('Visitor', 'Country');
//$this->code_country = $this->country->ip_info("Visitor", "Country Code");
$this->name_country = 'PERU';
$this->code_country = 'PE';
}
开发者ID:NeuronsWork,项目名称:7tual,代码行数:25,代码来源:web.php
示例8: getActivityByMinutes
function getActivityByMinutes($productId)
{
$timezonestimestamp = gmt_to_local(local_to_gmt(), $this->config->item('timezones'));
$timezonestime = date('Y-m-d H:i:m', $timezonestimestamp);
$all_ret = array();
$version = "all";
for ($i = 29; $i >= 0; $i--) {
$all_size = 0;
$dataStr = date('Y-m-d-H-i', strtotime("-{$i} minutes", strtotime($timezonestime)));
$allAcs = $this->redis->keys("razor_r_ac_p_" . $productId . "_" . $dataStr . "*");
if ($allAcs && count($allAcs) > 0) {
for ($k = 0; $k < count($allAcs); $k++) {
$key = $allAcs[$k];
$len = $this->redis->hlen($key);
$all_size += $len;
}
}
if ($i == 0) {
$onlinedata = array('minutes' => lang("v_rpt_realtime_now"), 'size' => $all_size);
} else {
$onlinedata = array('minutes' => "- " . $i . lang("v_rpt_realtime_minutes"), 'size' => $all_size);
}
array_push($all_ret, $onlinedata);
}
return json_encode($all_ret);
}
开发者ID:newbeess,项目名称:razor,代码行数:26,代码来源:pageviewmodel.php
示例9: postDate
function postDate($time, $format = "%M %d %Y %h:%i%a")
{
$timezone = $this->session->userdata("timezone");
if (empty($timezone)) {
$timezone = "UTC";
}
return mdate($format, gmt_to_local($time, $timezone));
}
开发者ID:kangtanto,项目名称:clvrfst,代码行数:8,代码来源:theme.php
示例10: trigger_convert_to_local
function trigger_convert_to_local($time = '', $gmt_offset, $format = 'Y-m-d H:i:s')
{
$CI =& get_instance();
$time = !is_numeric($time) ? strtotime(str_replace('/', '-', $time)) : $time;
$timezone = $gmt_offset;
$daylight_saving = date("I") == 1 ? TRUE : FALSE;
$time = gmt_to_local($time, $timezone, $daylight_saving);
return date($format, $time);
}
开发者ID:dimplewraich,项目名称:finalproject,代码行数:9,代码来源:local_time_helper.php
示例11: get_est_time
function get_est_time()
{
$now = time();
$gmt = local_to_gmt($now);
$timezone = 'UM4';
$daylight_saving = FALSE;
$tt = gmt_to_local($gmt, $timezone, $daylight_saving);
return $tt;
}
开发者ID:khanals,项目名称:rbs-ext,代码行数:9,代码来源:MY_date_helper.php
示例12: convert_from_gmt
function convert_from_gmt($gmt_date,$timezone)
{
//echo $gmt_date;
if($gmt_date && $timezone){
return mdate("%d/%m/%Y %H:%i",gmt_to_local(strtotime($gmt_date),$timezone,false));
}
else{
return "";
}
}
开发者ID:rrrhys,项目名称:SMS-Gateway,代码行数:11,代码来源:gmt_helper.php
示例13: aktifkan
public function aktifkan($uid)
{
$this->db->where('uid', $uid);
$query = $this->db->get('user');
if ($query->num_rows() > 0) {
$this->db->where('uid', $uid);
$this->db->update('user', array('stat' => '1', 'aktif' => gmt_to_local(time(), 'UP7', FALSE)));
return TRUE;
} else {
return FALSE;
}
}
开发者ID:mylastof,项目名称:bede,代码行数:12,代码来源:User_model.php
示例14: submit
public function submit($username, $password, $nama, $alamat, $email, $kota, $hp)
{
$datestring = '%d/%m/%y';
$time = time();
$tarif = $this->config->item('biaya');
$transfer = $tarif + substr($hp, -3);
$unik = random_string('alnum', 6);
$pass = do_hash($password . $unik);
$secure_pass = $unik . '_' . $pass;
$data = array('userid' => strtolower($username), 'password' => $secure_pass, 'stat' => '0', 'nama' => $nama, 'alamat' => $alamat, 'kota' => $kota, 'telepon' => $hp, 'email' => strtolower($email), 'transfer' => $transfer, 'daftar' => gmt_to_local(time(), 'UP7', FALSE), 'uid' => do_hash($username));
$this->db->insert('user', $data);
return TRUE;
}
开发者ID:mylastof,项目名称:bede,代码行数:13,代码来源:Register_model.php
示例15: __construct
public function __construct()
{
parent::__construct();
$this->load->model('manager_model');
/* Obtenemos la fecha actual */
date_default_timezone_set('UTC');
$timestamp = now();
$timezone = 'UM5';
$daylight_saving = FALSE;
$now = gmt_to_local($timestamp, $timezone, $daylight_saving);
$datestring = "%Y-%m-%d %h:%i:%s";
$this->now = mdate($datestring, $now);
}
开发者ID:NeuronsWork,项目名称:7tual,代码行数:13,代码来源:manager.php
示例16: time2date
/**
* 날짜 표출 형태 변경
*
* @author KangMin
*
* @param int $time
* @param string $datetime_type
*
* @return string
*/
function time2date($time, $datetime_type = SETTING_datetime_type)
{
$return = '';
if (IS_USER_LOGIN === TRUE) {
if (!empty($time)) {
$return = date($datetime_type, $time - (gmt_to_local($time, SETTING_default_timezone, FALSE) - gmt_to_local($time, USER_INFO_timezone, FALSE)));
}
} else {
if (!empty($time)) {
$return = date($datetime_type, $time);
}
}
return $return;
}
开发者ID:AidenJeon,项目名称:tapbbs_cikorea,代码行数:24,代码来源:tapbbs_helper.php
示例17: save
function save($id = null)
{
// Keep track if this is a new user
$is_new = empty($id);
// Redirect unauthenticated users to signin page
if (!$this->authentication->is_signed_in()) {
redirect('account/sign_in/?continue=' . urlencode(base_url() . 'car/schedules'));
}
// Check if they are allowed to Update Users
if (!$this->authorization->is_permitted('car_schedule_manage') && !empty($id)) {
$this->session->set_flashdata('parmission', 'You have no permission to update Schedule');
redirect(base_url() . 'dashboard');
}
// Check if they are allowed to Create Users
if (!$this->authorization->is_permitted('car_schedule_add') && empty($id)) {
$this->session->set_flashdata('parmission', 'You have no permission to add Schedule');
redirect(base_url() . 'dashboard');
}
// Retrieve sign in user
$data['account'] = $this->account_model->get_by_id($this->session->userdata('account_id'));
$data['action'] = 'create';
$this->form_validation->set_error_delimiters('<div class="field_error">', '</div>');
$this->form_validation->set_rules(array(array('field' => 'route_id', 'label' => 'lang:select_route', 'rules' => 'trim|required'), array('field' => 'car_id', 'label' => 'lang:select_car', 'rules' => 'trim|required'), array('field' => 'type', 'label' => 'lang:schedule_type', 'rules' => 'trim|required'), array('field' => 'time', 'label' => 'lang:schedule_time', 'rules' => 'trim|required'), array('field' => 'status', 'label' => 'lang:status', 'rules' => 'trim|required')));
// Run form validation
if ($this->form_validation->run()) {
if (empty($id)) {
$now = gmt_to_local(now(), 'UP5', TRUE);
$data = array('route_id' => $this->input->post('route_id', TRUE), 'car_id' => $this->input->post('car_id', TRUE), 'schedule_type' => $this->input->post('type', TRUE), 'start_time' => $this->input->post('time', TRUE), 'enable' => $this->input->post('status', TRUE), 'create_user_id' => $data['account']->username, 'create_date' => mdate('%Y-%m-%d %H:%i:%s', $now));
//print_r($data);
$schedule_id = $this->general->save_into_table_and_return_insert_id('car_schedule', $data);
$this->session->set_flashdata('message_success', lang('success_add'));
//redirect('car/schedules');
} else {
$now = gmt_to_local(now(), 'UP5', TRUE);
$data = array('route_id' => $this->input->post('route_id', TRUE), 'car_id' => $this->input->post('car_id', TRUE), 'schedule_type' => $this->input->post('type', TRUE), 'start_time' => $this->input->post('time', TRUE), 'enable' => $this->input->post('status', TRUE), 'update_user_id' => $data['account']->username, 'update_date' => mdate('%Y-%m-%d %H:%i:%s', $now));
$this->general->update_table('car_schedule', $data, 'schedule_id', $id);
$this->session->set_flashdata('message_success', lang('success_update'));
redirect('car/schedules');
}
}
// Get the account to update
if (!$is_new) {
$data['update_details'] = $this->general->get_all_table_info_by_id('car_schedule', 'schedule_id', $id);
$data['action'] = 'update';
}
$data['all_car'] = $this->general->get_list_view('car_info', $field_name = NULL, $id = NULL, $select = NULL, 'car_id', 'desc', NULL, NULL);
redirect('car/schedules');
// $this->load->view('car/car_schedules', $data);
}
开发者ID:ahsanullah716,项目名称:ssw2015,代码行数:49,代码来源:schedules.php
示例18: projectdetail
function projectdetail($var = 'id', $id)
{
/* Database Initiation */
$q = $this->db->get_where('ch_project', array('project_id' => $id));
$row = $q->row();
$s = $this->db->get_where('ch_user', array('user_id' => $row->project_user_id));
$row_user = $s->row();
$r = $this->db->get_where('ch_projectreward', array('project_id' => $id));
$reward = $r->row();
/* Data Inititaion */
$time = $row->project_time;
$datetime = human_to_unix($time);
$data['project_until'] = standard_date('DATE_COOKIE', gmt_to_local($datetime, 'UP7', 'FALSE'));
$data['sidebar_amount_funding'] = $row->amount_funding;
$data['project_title'] = $row->project_name;
$data['project_author'] = $row_user->name;
$data['user_location'] = $row_user->location;
$data['user_bio'] = $row_user->bio;
$data['title'] = $row->project_name . ' by ' . $row_user->name;
$data['topmenu'] = $this->projectmodel->menu_top($var, $id);
$data['project_location'] = $row->project_location;
$data['user_avatar'] = $row_user->avatar;
for ($i = 1; $i < 6; $i++) {
$rew = "reward_{$i}";
$count = "count_{$i}";
$data["donate_{$i}"] = $reward->{$rew};
$data["count_{$i}"] = $reward->{$count};
}
switch ($var) {
case 'id':
$data['project_home'] = $row->project_home;
$data['project_video'] = $row->project_video;
$this->projectmodel->template($data, "chprojectdetail");
break;
case 'updates':
$data['project_updates'] = $this->projectmodel->project_updates($id);
$data['project_updates_form'] = $this->projectmodel->editor($id);
$this->projectmodel->template($data, "chprojectupdates");
break;
case 'comments':
$data['project_comments'] = $this->projectmodel->project_comments($id);
$this->projectmodel->template($data, "chprojectcomments");
break;
default:
$data['project_home'] = $row->project_home;
$this->projectmodel->template($data, "chprojectdetail");
break;
}
}
开发者ID:irhamnurhalim,项目名称:chordeo,代码行数:49,代码来源:project.php
示例19: anadir_inscripciones
public function anadir_inscripciones($data)
{
$timestamp = time();
//$fecha_nac = date ("Y-m-d H:i:s", strtotime($data['fecha_nacimiento'])); // date("Y-m-d H:i:s", );
//$this->db->set( 'fecha_nacimiento', $fecha_nac );
$this->db->set('identificador', $data['identificador']);
$this->db->set('nombre', $data['nombre']);
$this->db->set('apellidop', $data['apellidop']);
$this->db->set('apellidom', $data['apellidom']);
$this->db->set('fecha_nacimiento', $data['fecha_nacimiento']);
$this->db->set('email', $data['email']);
$this->db->set('licencia', $data['licencia']);
$this->db->set('vigencia', $data['vigencia']);
/*$this->db->set( 'calle', $data['calle'] );
$this->db->set( 'colonia', $data['colonia'] );
$this->db->set( 'delegacion', $data['delegacion'] );
$this->db->set( 'ciudad', $data['ciudad'] );
$this->db->set( 'cpostal', $data['cpostal'] );
$this->db->set( 'referencia', $data['referencia'] );*/
$this->db->set('oficina', $data['oficina']);
//$this->db->set( 'telefono', $data['telefono'] );
$this->db->set('celular', $data['celular']);
//$this->db->set( 'telefono2', $data['telefono2'] );
/*$this->db->set( 'modelo', $data['modelo'] );
$this->db->set( 'ano_modelo', $data['ano_modelo'] );
$this->db->set( 'placa', $data['placa'] );
$this->db->set( 'serie', $data['serie'] );*/
$this->db->set('nombA1', $data['nombA1']);
$this->db->set('edadA1', $data['edadA1']);
$this->db->set('nombA2', $data['nombA2']);
$this->db->set('edadA2', $data['edadA2']);
$this->db->set('comentario', $data['comentario']);
$this->db->set('coleccion_id_aviso', $data['coleccion_id_aviso']);
$this->db->set('unixtime', gmt_to_local($timestamp, $this->timezone, TRUE));
$this->db->set('ip', $data['ip']);
$this->db->set('navegador', $data['navegador']);
$this->db->set('periodo', $data['periodo']);
$this->db->set('microsite', $data['microsite']);
$this->db->set('trafico', $data['origin']);
$this->db->insert($this->registro_inscripciones);
if ($this->db->affected_rows() > 0) {
return TRUE;
} else {
return FALSE;
}
$result->free_result();
}
开发者ID:estrategasdigitales,项目名称:Raticate,代码行数:47,代码来源:model_inscripciones.php
示例20: getOnlineUsers
function getOnlineUsers($productId)
{
$timezonestimestamp = gmt_to_local(local_to_gmt(), $this->config->item('timezones'));
$timezonestime = date('Y-m-d H:i:m', $timezonestimestamp);
$ret = array();
for ($i = 30; $i >= 0; $i--) {
$dataStr = date('Y-m-d-H-i', strtotime("-{$i} minutes", strtotime($timezonestime)));
$size = $this->redis->hlen("razor_r_u_p_" . $productId . "_" . $dataStr);
if ($i == 0) {
$onlinedata = array('minutes' => lang("v_rpt_realtime_now"), 'size' => $size);
} else {
$onlinedata = array('minutes' => "- " . $i . lang("v_rpt_realtime_minutes"), 'size' => $size);
}
array_push($ret, $onlinedata);
}
return $ret;
}
开发者ID:newbeess,项目名称:razor,代码行数:17,代码来源:onlineusermodel.php
注:本文中的gmt_to_local函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论