views:

92

answers:

1

I am developing a component in Joomla. Through my component I want to store timestamp to "lastaccessed" field.

My problem is that, if I am simply storing the date, then MySQL is displaying it as "0000-00-00 00:00:00"

I am using the PHP date function like this:

$row->date_lastaccessed=date();

How can I store and retrieve the date in my format (dd-mm-yyyy hh:mm:ss ampm)?

+1  A: 

Have you looked at:

http://php.net/manual/en/function.date.php

greenkoi
I am accepting this answer because it helped me to achieve what i want. Thanks GK
SIA