<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This class will provide parsing service for date time format:
* month/date/year and hour:minute:second
*
* @author : irfanudin ridho
* @email : irfan.ub@gmail.com
* @version : 1.0
* @date : February 20, 2011
*/
class Parser {
function parsee($data)
{
$this->datee = $data['date'];
$this->timee = $data['time'];
$this->date = array();
foreach(explode('/',$this->datee) as $value){
$this->date[] = $value;
}
$this->time = array();
foreach(explode(':', $this->timee) as $value){
$this->time[] = $value;
}
}
function get_date(){
return $this->date[1];
}
function get_month(){
return $this->date[0];
}
function get_year(){
return $this->date[2];
}
function get_hour(){
return $this->time[0];
}
function get_minute(){
return $this->time[1];
}
function get_second(){
return $this->time[2];
}
}
?>
No comments:
Post a Comment