开发者

How to store and display date in dd-mm-yy format in Joomla?

开发者 https://www.devze.com 2022-12-22 02:39 出处:网络
I am developing开发者_运维知识库 a component in Joomla. Through my component I want to store timestamp to \"lastaccessed\" field.

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)?


Have you looked at:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号