Home >>PHP Date Time Functions
There are various functions that are used to display the time and date in the PHP language and that are called as PHP Date/Time Functions. These functions are used to fetch the time and date from the server where the PHP script runs.
Function | Description |
---|---|
checkdate() | This function is used to validates a Gregorian date |
date_add() | This function is used to add days, months, years, hours, minutes, and seconds to a date |
date_create_from_format() | This function is used to return a new DateTime object formatted according to a specified format |
date_create() | It is used to return a new DateTime object |
date_date_set() | This is basically used to set a new date |
date_default_timezone_get() | This is the function that is used to return the default timezone used by all date/time functions |
date_default_timezone_set() | This is the function that generally sets the default timezone used by all date/time functions |
date_diff() | This function is used to return the difference between two dates |
date_format() | This function is used to return a date formatted according to a specified format |
date_get_last_errors() | This function is used to return the warnings/errors found in a date string |
date_interval_create_from_date_string() | This function use lies in setting up a DateInterval from the relative parts of the string |
date_interval_format() | This is the function that is generally used to format the interval |
date_isodate_set() | It is generally used to set the ISO date |
date_modify() | This function is basically used to modify the timestamp |
date_offset_get() | This function is used to return the timezone offset |
date_parse_from_format() | This function is used to return an associative array with detailed info about a specified date, according to a specified format |
date_parse() | This function is used to return an associative array with detailed info about a specified date |
date_sub() | It is the function that is generally used to subtract the days, months, years, hours, minutes, and seconds from a date |
date_sun_info() | This function is used to return an array containing info about sunset/sunrise and twilight begin/end, for a specified day and location |
date_sunrise() | This function is used to return the sunrise time for a specified day and location |
date_sunset() | This function is used to return the sunset time for a specified day and location |
date_time_set() | It is used to set the time |
date_timestamp_get() | It is used to return the Unix timestamp |
date_timestamp_set() | It is used to set the date and time based on a Unix timestamp |
date_timezone_get() | It is used to return the time zone of the given DateTime object |
date_timezone_set() | It is used to set the time zone for the DateTime object |
date() | This is the function that is used to format a local date and time |
getdate() | This function is basically used to return date/time information of a timestamp or the current local date/time |
gettimeofday() | This function is basically used to return the current time |
gmdate() | This is the function that is used to format a GMT/UTC date and time |
gmmktime() | This function is basically used to return the Unix timestamp for a GMT date |
gmstrftime() | This is the function that is used to format a GMT/UTC date and time according to locale settings |
idate() | This is the function that is used to format a local time/date as integer |
localtime() | It is the function that is generally used to return the local time |
microtime() | It is the function that is generally used to return the current Unix timestamp with microseconds |
mktime() | It is the function that is generally used to return the Unix timestamp for a date |
strftime() | It is the function that is generally used to format a local time and/or date according to locale settings |
strptime() | This function is used to parse a time/date generated with strftime() |
strtotime() | This function is used to parse an English textual datetime into a Unix timestamp |
time() | This function is basically used to return the current time as a Unix timestamp |
timezone_abbreviations_list() | It is basically used to return an associative array containing dst, offset, and the timezone name |
timezone_identifiers_list() | This function is used to return an indexed array with all timezone identifiers |
timezone_location_get() | It is the function that is generally used to return location information for a specified timezone |
timezone_name_from_ abbr() | This function of PHP date and time is used to return the timezone name from abbreviation |
timezone_name_get() | This function is known to return the name of the timezone |
timezone_offset_get() | This function is known the timezone offset from GMT |
timezone_open() | This function generally creates a new DateTimeZone object |
timezone_transitions_get() | This function is generally used to return all transitions for the timezone |
timezone_version_get() | This is the function that is majorly used to return the version of the timezonedb |