The date function and the time function in PHP.
The time () function is to get the current timestamp from January 1, 1970 Zero 0 minutes and 0 seconds
The date () function is a formatted timestamp. Does anyone know how he formatted it? Like if I had a time stamp, can I figure out the time myself? The time () timestamp gets the cumulative and of the seconds. But I tried to divide the time stamp by 60 equals points. Divided by 60 equals the hour divided by 24 How is it wrong?
------Solution--------------------
Landlord is said to get time stamp divided 24 hours a day to get days plus 1970 years
Gets the current time.
The question is 365 days a year or 366 days?
Just like getting the month is also, 28 days one months, 31 is also one months!
------Solution--------------------
That second count can only be counted to days. Because of the existence of leap years, it is not easy to draw.
------Solution--------------------
function ToDate ($time)//convert time to date
{
$arr =getdate ($time);
Echo $arr [year], "years", $arr [mon], "month", $arr [Mday], "Day", $arr [hours], "when", $arr [minutes], "min", $arr [seconds], "SEC";
}
Perfect solution
------Solution--------------------
PHP Code
function ToDate ($time)