Αποτελέσματα Αναζήτησης
The date() function formats a local date and time, and returns the formatted date string.
- Try It Yourself
echo date("l") . "<br>"; // Prints the day, date, month,...
- PHP Date/Time Functions
The date/time functions allow you to get the date and time...
- PHP Date and Time
The example below creates a date and time with the date()...
- Try It Yourself
The example below creates a date and time with the date() function from a number of parameters in the mktime() function:
echo date("l") . "<br>"; // Prints the day, date, month, year, time, AM or PM. echo date("l jS \of F Y h:i:s A") . "<br>"; // Prints October 3, 1975 was on a Friday.
3 Μαρ 2023 · PHP provides a variety of built-in functions for working with dates, including date(), time(), and strtotime(). These functions allow you to format and manipulate dates in a variety of ways, including changing the format of the date, adding or subtracting time from a date, and more.
date. (PHP 4, PHP 5, PHP 7, PHP 8) date — Format a Unix timestamp. Description ¶. date (string $format, ? int $timestamp = null): string. Returns a string formatted according to the given format string using the given integer timestamp (Unix timestamp) or the current time if no timestamp is given.
Syntax: Copy Code. date(string format, int timestamp) The date () function returns a formatted string representing a date; a passing second-time parameter is optional, the current local timestamp will be used if no timestamp is given.
The date/time functions allow you to get the date and time from the server where your PHP script runs. You can then use the date/time functions to format the date and time in several ways. Note: These functions depend on the locale settings of your server.