날짜(date) Sample

<?php
/**
 * Date helper
 *
 * Created on 2011. 11. 18.
 * @author 불의회상 <hoksi2k@hanmail.net>
 * @package helper
 * @subpackage controllers
 * @version 1.0
 */
class Date_hlp extends CI_Controller {
	function __construct()
	{
		parent::__construct();
	}
	
	function index() {
		// Date Helper Load
		$this->load->helper('date');

		$data['now'] = now();
		$this->load->view('date_hlp_sample', $data);
	}
}
<?php $this->load->view('inc/header')?>

<table class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr>
  <th style="text-align:center" colspan="2">Date Helper</th>
</tr>
</thead>
<thead>
<tr>
  <th style="text-align:center" width="20%">구분</th>
  <th width="80%">결과</th>
</tr>
</thead>
<tr>
	<td>now()</td>
	<td><?php echo $now?></td>
</tr>
<tr>
	<td>mdate("Year: %Y Month: %m Day: %d - %h:%i %a")</td>
	<td><?php echo mdate("Year: %Y Month: %m Day: %d - %h:%i %a")?></td>
</tr>
<tr>
	<td>standard_date('DATE_RFC822')</td>
	<td><?php echo standard_date('DATE_RFC822')?></td>
</tr>
<tr>
	<td>local_to_gmt()</td>
	<td><?php echo local_to_gmt()?></td>
</tr>
<tr>
	<td>gmt_to_local('1140153693', 'UM8', TRUE)</td>
	<td><?php echo gmt_to_local('1140153693', 'UM8', TRUE)?></td>
</tr>
<tr>
	<td>mysql_to_unix('20061124092345')</td>
	<td><?php echo mysql_to_unix('20061124092345')?></td>
</tr>
<tr>
	<td>unix_to_human(now())</td>
	<td><?php echo unix_to_human(now())?></td>
</tr>
<tr>
	<td>human_to_unix('2012-05-22 06:50 PM')</td>
	<td><?php echo human_to_unix('2012-05-22 06:50 PM')?></td>
</tr>
<tr>
	<td>timespan('1079621429')</td>
	<td><?php echo timespan('1337680200')?></td>
</tr>
<tr>
	<td>days_in_month('05', '2012')</td>
	<td><?php echo days_in_month('05', '2012')?></td>
</tr>
</table>

<?php $this->load->view('inc/footer')?>

© Copyright by hoksi(Page rendered in 0.0061 seconds)