Home >Backend Development >PHP Tutorial >php timestamp
UNIX timestamp
date Format a local time and date
time() returns the current UNIX timestamp
microtime returns the current UNIX timestamp and microseconds
localtime gets the local time
date_default_timezone_get (time zone) Get the default time zone used by all date and time functions in a script
date_default_timezone_set Set the default time zone used by all date and time functions in a script
date_sunrise Returns the sunrise time for the given date and location
date_sunset returns The sunset time of a given date and location
getdate gets the date and time information
liezi
The above methods are all
<?php date_default_timezone_get(时区); echo date("Y-m-d",time()); ?>