Kris Roofe Kris Roofe - 1 month ago 12
PHP Question

How to convert laravel timestamp to a string(php)?

I use laravel as my php framework. In my database, I have a

create_at
field that is created with
timestamp()
. I use the databse:query builder to get this field, which is not a simple string.

How can I convert this to a simple string, such as
2016-07-08 22:09:08
?

I use
''.$variable->create_at
before.

Answer
date("Y-m-d H:i:s", $timestamp);
Comments