PHP:date()返回零日期

Hey guys i'm trying to use the date() function for my website but when I do it returns 0000-00-00. I am using this code:

$date = date();

Using that it will return "0000-00-00".

What could be causing this? Sorry I can't provide much more information as that is the only thing I can think to give you.

Any help is appreciated.

Check out the Docs for the DateTime functions here

As yes123 says, date() requires a parameter that defines what format you want to get the results in. If you want yyyy-mm-dd, use date( 'Y-m-d' ). If you just want the timestamp use time() instead.