Home >>PHP Date Time Functions

PHP Date Time Functions

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

PHP Date Time Functions Index

Sr.No. Topics
1 PHP checkdate() Function
2 PHP date_add() Function
3 PHP date_create_from_format() Function
4 PHP date_create() Function
5 PHP date_date_set() Function
6 PHP date_default_timezone_get() Function
7 PHP date_default_timezone_set() Function
8 PHP date_diff() Function
9 PHP date_format() Function
10 PHP date_get_last_errors() Function
11 PHP date_interval_create_from_date_string() Function
12 PHP date_interval_format() Function
13 PHP date_isolate_set() Function
14 PHP date_modify() Function
15 PHP date_offset_get() Function
16 PHP date_parse_from_format() Function
17 PHP date_parse() Function
18 PHP date_sub() Function
19 PHP date_sun_info() Function
20 PHP date_sunrise() Function
21 PHP date_sunset() Function
22 PHP date_time_set() Function
23 PHP date_timestamp_get() Function
24 PHP date_timestamp_set() Function
25 PHP date_timezone_get() Function
26 PHP date_timezone_set() Function
27 PHP date() Fuction
28 PHP getdate() Function
29 PHP gettimeofday() Function
30 PHP gmdate() Function
31 PHP gmmktime() Function
32 PHP gmstrftime() Function
33 PHP idate() Function
34 PHP localtime() Function
35 PHP microtime() Function
36 PHP mktime() Function
37 PHP strftime() Function
38 PHP strptime() Function
39 PHP strtotime() Function
40 PHP time() Function
41 PHP timezone_abbreviations_list() Function
42 PHP timezone_identifiers_list() Function
43 PHP timezone_location_get() Function
44 PHP timezone_name_from_abbr() Function
45 PHP timezone_name_get() Function
46 PHP timezone_offset_get() Function
47 PHP timezone_open() Function
48 PHP timezone_transitions_get() Function
49 PHP timezone_version_get() function

No Sidebar ads