Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Monday, September 13, 2010

Joomla 1.5 - Created date to mySql

Joomla! allows you to set date values through the Joomla! framework whenever you want to save a date to the database.

To use a the current date/time in your JModel entended class, do the following.

In the store() method after the $row->bind() method, add:

//Get a JDate object
$createdate = &JFactory::getDate();
//Create a date in MySQL's datetime format
$row->created = $createdate->toMySQL();
//PS: make sure your table have a created field :)



Joomla!'s JDate also allows you to set custom Unix dates simply by passing in the date to JFactory::getDate() method. E.g.

$createdate =& JFactory::getDate(time());

Note that you wil override the date everytime you save to the database. See if you can modify the model to set the create date only on new saves. :)

See Joomla!'s API documentation for more on what JDate can do.

http://api.joomla.org/Joomla-Framework/Utilities/JDate.html

Monday, July 14, 2008

keepr

Today I would like to introduce keepr, a php cms/framework I am working on in my free time.

It all started in May/June 2007. I was without a job and needed something to help me deliver projects faster without forcing me to change the way I like to code. It impliments the way I see Model-View-Controller for the web environment using PHP XTemplate

I launched a GNU GPL version 3 at the following url http://code.google.com/p/keepr/ . There is no downloads yet by the full source is available at Source/Browse under trunk.