BWSnippet

Make MYSQL DATE pretty

Make MYSQL DATE pretty

Take DATE and get a pretty version

using:

date('F jS Y', strtotime($this->updatedDate) );

or Use a function for a common model need

	public function PrettyDate()
	{
		if( isset($this->updatedDate) )
			return date('F jS Y', strtotime($this->updatedDate) );
		else
			return date('F jS Y', strtotime($this->createdDate) );
	}

Would output something like:

April 24th 2013

Tags

Make MYSQL DATE pretty