当前位置: 首页>>代码示例>>PHP>>正文


PHP standard_date函数代码示例

本文整理汇总了PHP中standard_date函数的典型用法代码示例。如果您正苦于以下问题:PHP standard_date函数的具体用法?PHP standard_date怎么用?PHP standard_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了standard_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct()
 {
     parent::__construct();
     $this->load->library('uri');
     $this->load->helper('file');
     $segments = $this->uri->segment_array();
     array_shift($segments);
     $path = APPPATH . '../assets';
     foreach ($segments as $segment) {
         $path .= '/' . $segment;
     }
     if (realpath($path) !== false) {
         $data = read_file($path);
         if (php_sapi_name() == 'apache2handler' || php_sapi_name() == 'apache') {
             $headers = apache_request_headers();
             if (isset($headers['If-Modified-Since']) && !empty($headers['If-Modified-Since'])) {
                 header('Not Modified', true, 304);
                 exit;
             }
         }
         header('Content-Type: ' . get_mime_by_extension(basename($path)));
         header('Cache-Control: max-age=3600, must-revalidate');
         header('Last-Modified: ' . standard_date('DATE_COOKIE', filemtime($path)));
         echo $data;
         exit;
     } else {
         show_error('Asset does not exist in repository.', 404);
     }
 }
开发者ID:pcisneros,项目名称:glab-ci-ext,代码行数:29,代码来源:Assets.php

示例2: insert

 public function insert()
 {
     if (null === $this->time_recorded) {
         $this->time_recorded = standard_date('DATE_ISO8601', time());
     }
     parent::insert();
 }
开发者ID:GothamGazette,项目名称:Maze,代码行数:7,代码来源:response_log_delegate.php

示例3: 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

示例4: index

 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  *	- or -  
  * 		http://example.com/index.php/welcome/index
  *	- or -
  * Since this controller is set as the default controller in 
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://codeigniter.com/user_guide/general/urls.html
  */
 public function index($message = "")
 {
     $this->load->helper('form');
     $this->load->helper('url');
     $this->load->library('session');
     if ($this->session->userdata('validated')) {
         redirect('admin_view');
     }
     $form_elem = array('User Name' => array('input' => 'text', 'name' => 'UserName', 'id' => 'uid', 'type' => 'text', 'label' => 'User Name', 'class' => 'required'), 'Password' => array('input' => 'text', 'name' => 'Password', 'id' => 'pass', 'type' => 'password', 'label' => 'Password', 'class' => 'required'), 'Submit' => array('input' => 'submit', 'value' => 'Log In', 'type' => 'submit'));
     $form_attr = array('id' => 'loginForm');
     $this->load->helper('date');
     $time = time();
     $base_url = base_url();
     date_default_timezone_set('Asia/Calcutta');
     $institutename = 'IIIT-D';
     $format = 'DATE_RFC822';
     $datestring = standard_date($format, $time);
     $data['date'] = $datestring;
     $data['ins_name'] = $institutename;
     $cssfiles[] = "styles.css";
     $data['css'] = $cssfiles;
     $data['form_elem'] = $form_elem;
     $data['form_attr'] = $form_attr;
     $data['msg'] = $message;
     $data['scripts'] = array('jquery.js', 'jquery.infieldlabel.js', 'jquery.validate.js');
     $this->load->view('admin_login', $data);
 }
开发者ID:kumarsivarajan,项目名称:cse300-group10,代码行数:42,代码来源:admin.php

示例5: upload_profile_photo

 public function upload_profile_photo()
 {
     $date_dir = 'profile_photos/';
     $config['upload_path'] = 'uploads/profile_photos/';
     $config['allowed_types'] = 'gif|jpg|JPG|png';
     $config['max_size'] = '5120';
     $this->load->library('upload', $config);
     $this->upload->display_errors('', '');
     if ($this->upload->do_upload('photoimg')) {
         $data = $this->upload->data();
         $this->load->helper('date');
         $format = 'DATE_RFC822';
         $time = time();
         $media['media_name'] = $data['file_name'];
         $media['media_url'] = base_url() . 'uploads/profile_photos/' . $data['file_name'];
         $media['create_time'] = standard_date($format, $time);
         $media['status'] = 1;
         create_square_thumb('./uploads/profile_photos/' . $data['file_name'], './uploads/profile_photos/thumb/');
         $status['error'] = 0;
         $status['name'] = $data['file_name'];
     } else {
         $errors = $this->upload->display_errors();
         $errors = str_replace('<p>', '', $errors);
         $errors = str_replace('</p>', '', $errors);
         $status = array('error' => $errors, 'name' => '');
     }
     echo json_encode($status);
     die;
 }
开发者ID:Thavia,项目名称:plb,代码行数:29,代码来源:Perfil.php

示例6: _build_feed

	function _build_feed( $posts = array() )
	{
		$this->data->rss->encoding = $this->config->item('charset');
		$this->data->rss->feed_name = $this->settings->item('site_name');
		$this->data->rss->feed_url = base_url();
		$this->data->rss->page_description = sprintf($this->lang->line('blog_rss_posts_title'), $this->settings->item('site_name'));
		$this->data->rss->page_language = 'en-gb';
		$this->data->rss->creator_email = $this->settings->item('contact_email');
		
		if(!empty($posts))
		{        
			foreach($posts as $row)
			{
				//$row->created_on = human_to_unix($row->created_on);
				$row->link = site_url('blog/' .date('Y/m', $row->created_on) .'/'. $row->slug);
				$row->created_on = standard_date('DATE_RSS', $row->created_on);
				
				$item = array(
					//'author' => $row->author,
					'title' => xml_convert($row->title),
					'link' => $row->link,
					'guid' => $row->link,
					'description'  => $row->intro,
					'date' => $row->created_on
				);				
				$this->data->rss->items[] = (object) $item;
			} 
		}	
	}
开发者ID:reith2004,项目名称:pyrocms,代码行数:29,代码来源:rss.php

示例7: uploadImage

 function uploadImage($filename)
 {
     $config['upload_path'] = './assets/images/';
     $config['allowed_types'] = 'gif|jpg|png';
     $config['max_size'] = '1024';
     $config['max_width'] = '';
     $config['max_height'] = '';
     $this->load->library('upload');
     $this->upload->initialize($config);
     $this->load->library('upload', $config);
     if (!$this->upload->do_upload($filename)) {
         $error = array('error' => $this->upload->display_errors());
         return $this->upload->display_errors();
     } else {
         $data = $this->upload->data();
         $this->load->helper('date');
         $format = 'DATE_RFC822';
         $time = time();
         $media['media_name'] = $data['raw_name'] . '_thumb' . $data['file_ext'];
         $media['media_url'] = base_url() . 'assets/images/thumb/' . $data['raw_name'] . '_thumb' . $data['file_ext'];
         $media['create_time'] = standard_date($format, $time);
         $media['created_by'] = $this->media_model->get_id_by_username($this->session->userdata('user_name'));
         $media['status'] = 1;
         $this->media_model->insert_media($media);
         return $data;
     }
     return;
 }
开发者ID:firastunsi,项目名称:oskon,代码行数:28,代码来源:media_core.php

示例8: after_update_log

 /**
  * Registro de trazas al actualizar datos
  */
 function after_update_log($value, $primary_key)
 {
     $format = 'DATE_RFC822';
     $time = time();
     $date = standard_date($format, $time);
     $data = array('action' => 'update', 'user' => $this->session->userdata('username'), 'section' => 'Palabras Claves', 'fk_section' => $primary_key, 'date' => $date);
     $this->db->insert('user_log', $data);
 }
开发者ID:jorgemunoz8807,项目名称:admin_portal,代码行数:11,代码来源:tags.php

示例9: index

    public function index()
    {
        $this->load->library('calendar');
        $this->load->helper('date');
        $datestring = "%Y-%m-%d";
        $time = time();
        echo mdate($datestring, $time) . "<br>";
        echo mdate("%Y-%m-%d", time()) . "<br>";
        $datestring = "Year: %Y Month: %m Day: %d - %h:%i %a";
        $time = time();
        echo mdate($datestring, $time) . "<br>";
        $format = 'DATE_RFC822';
        $time = time();
        echo standard_date($format, $time) . "<br>";
        $this->load->library('calendar');
        echo $this->calendar->generate() . "<br>";
        echo $this->calendar->generate(2006, 6) . "<br>";
        $data = array(3 => 'http://01fes.com/news/article/2006/03/', 7 => 'http://01fes.com/news/article/2006/07/', 13 => 'http://01fes.com/news/article/2006/13/', 26 => 'http://01fes.com/news/article/2006/26/');
        echo $this->calendar->generate(2006, 6, $data) . "<br>";
        $prefs = array('show_next_prev' => TRUE, 'next_prev_url' => 'http://example.com/index.php/calendar/show/');
        $this->load->library('calendar', $prefs);
        echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4)) . "<br>";
        $prefs['template'] = '

   {table_open}<table border="0" cellpadding="0" cellspacing="0">{/table_open}

   {heading_row_start}<tr>{/heading_row_start}

   {heading_previous_cell}<th><a href="{previous_url}">&lt;&lt;</a></th>{/heading_previous_cell}
   {heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell}
   {heading_next_cell}<th><a href="{next_url}">&gt;&gt;</a></th>{/heading_next_cell}

   {heading_row_end}</tr>{/heading_row_end}

   {week_row_start}<tr>{/week_row_start}
   {week_day_cell}<td>{week_day}</td>{/week_day_cell}
   {week_row_end}</tr>{/week_row_end}

   {cal_row_start}<tr>{/cal_row_start}
   {cal_cell_start}<td>{/cal_cell_start}

   {cal_cell_content}<a href="{content}">{day}</a>{/cal_cell_content}
   {cal_cell_content_today}<div class="highlight"><a href="{content}">{day}</a></div>{/cal_cell_content_today}

   {cal_cell_no_content}{day}{/cal_cell_no_content}
   {cal_cell_no_content_today}<div class="highlight">{day}</div>{/cal_cell_no_content_today}

   {cal_cell_blank}&nbsp;{/cal_cell_blank}

   {cal_cell_end}</td>{/cal_cell_end}
   {cal_row_end}</tr>{/cal_row_end}

   {table_close}</table>{/table_close}
';
        $this->load->library('calendar', $prefs);
        echo $this->calendar->generate();
    }
开发者ID:Hanif666,项目名称:Reservation-System,代码行数:57,代码来源:mydate.php

示例10: log

 function log($action)
 {
     $session_data = $this->session->userdata('logged_in');
     $this->load->helper('date');
     $format = 'DATE_RFC850';
     $time = time();
     $log = array('user_id' => $session_data['user_id'], 'action' => $action, 'time' => standard_date($format, $time));
     $this->db->insert('logs', $log);
 }
开发者ID:handsomepcm,项目名称:infostudent,代码行数:9,代码来源:registrar_model.php

示例11: index

 public function index()
 {
     $format = 'DATE_RFC822';
     $time = now('America/Argentina/Buenos_Aires');
     $data['fecha'] = standard_date($format, $time);
     $data['ip_remota'] = $this->input->ip_address();
     $txt = "\n" . $data['ip_remota'] . ";" . "acceso" . ";" . $data['fecha'] . ";" . $this->agente() . ";";
     write_file('application/logs/accesos.txt', $txt, 'a+');
     $this->load->view('welcome_message');
 }
开发者ID:dardoCamanio,项目名称:arg,代码行数:10,代码来源:Welcome.php

示例12: new_comment

 function new_comment()
 {
     $format = 'DATE_ATOM';
     $time = time();
     $data['name'] = $this->input->post('name');
     $data['post_id'] = $this->input->post('post_id');
     $post_id = $this->input->post('post_id');
     $data['comment'] = $this->input->post('comment');
     $data['posted_datetime'] = standard_date($format, $time);
     $this->comments_model->new_comment($data);
     echo "<h2 class='post'>" . $data['name'] . "</h2>";
     echo "<p class='post'>" . $data['comment'] . "</p>";
 }
开发者ID:pulpedhq,项目名称:thedailyfont,代码行数:13,代码来源:posts.php

示例13: 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

示例14: index

 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  *	- or -  
  * 		http://example.com/index.php/welcome/index
  *	- or -
  * Since this controller is set as the default controller in 
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://codeigniter.com/user_guide/general/urls.html
  */
 public function index()
 {
     $this->load->helper('url');
     $this->load->helper('date');
     $time = time();
     $base_url = base_url();
     date_default_timezone_set('Asia/Calcutta');
     $format = 'DATE_RFC822';
     $datestring = standard_date($format, $time);
     $data['date'] = $datestring;
     $navigation_data['navTab'] = 'home';
     $navigation_data['base_url'] = $base_url;
     $cssfiles[] = "styles.css";
     $data['css'] = $cssfiles;
     $data['content_navigation'] = $this->load->view('navigation_bar', $navigation_data, true);
     $this->load->view('error_page', $data);
 }
开发者ID:kumarsivarajan,项目名称:cse300-group10,代码行数:32,代码来源:error.php

示例15: _build_feed

 function _build_feed($posts = array())
 {
     $this->data->rss->encoding = $this->config->item('charset');
     $this->data->rss->feed_name = $this->settings->item('site_name');
     $this->data->rss->feed_url = base_url();
     $this->data->rss->page_description = 'News articles for ' . $this->settings->item('site_name');
     $this->data->rss->page_language = 'en-gb';
     $this->data->rss->creator_email = $this->settings->item('contact_email');
     if (!empty($posts)) {
         foreach ($posts as $row) {
             //$row->created_on = human_to_unix($row->created_on);
             $row->link = site_url('news/' . date('Y/m', $row->created_on) . '/' . $row->slug);
             $row->created_on = standard_date('DATE_RSS', $row->created_on);
             $item = array('title' => xml_convert($row->title), 'link' => $row->link, 'guid' => $row->link, 'description' => str_replace('/img/post_resources/', base_url() . 'img/post_resources/', $row->body), 'date' => $row->created_on);
             $this->data->rss->items[] = (object) $item;
         }
     }
 }
开发者ID:bema2004sw,项目名称:pyrocms,代码行数:18,代码来源:rss.php


注:本文中的standard_date函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。