The date function returns a formatted string of a date and time. the first parameter is a string that specifies how the date and time should be formatted. It can take a second, optional parameter of a timestamp. If no date and time or timestamp are passed, it uses now. It doesn't support time zones.

    
    $now = date("l jS \of F Y h:i:s A");
    echo $now;
    // Tuesday, 2nd November 2024 4:03:26 AM

    $now1 = date('Y-m-d H:i:s', mktime(11,0,0,10,3,1975));
    echo $now1;
    // 1975-10-03 11:00:00

Here is a list of the characters that can be used to format the date and time string:

The following predefined constants can also be used (available since PHP 5.1.0):