View Single Post
Old 01-30-2008, 07:19 AM   #1 (permalink)
sarmenhb
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Help help me understand OOP

what im trying to do is make a class that will somehow strip the hour,minute, and seconds from this function system("time") and display it when i do a call to the class. the reason im doing this is because im trying to make sense of oop and cant. for some reason i cant understand how to use oop in a page.

i need some help here, i have read chapter n chapters and saw videos online and cant seem to make sense of it.

heres my code

Code:
<?

Class Time
{


const timetype = 12;

public $hour;
public $minute;
public $second;

public function hour($p_hour)
{
	
	$this->hour = $p_hour;
	if($this->hour > 12)
	 {
	 	//do matth to convert time to 12 hour time. 
		  }
}


public function minute($p_minute)
{
	
	$this->minute = $p_minute;
}

public function second($p_second)
{
	
	$this->second = $p_second;
}


}

?>
thanks to all.
__________________
no signature set
sarmenhb is offline  
Reply With Quote