MySQL – Date and Time Functions
In MySQL, we have a set of functions using which we can manipulate the date and time values. Following are the MySQL date time functions −
Sr.No. | Name & Description |
---|---|
1 |
This function adds two given dates |
2 |
This function adds given time values |
3 |
This function converts from one timezone to another |
4 |
This function returns the current date |
5 |
Synonyms for CURDATE() |
6 |
Synonyms for CURTIME() |
7 |
Synonyms for NOW() |
8 |
This function returns the current time |
9 |
Adds two dates |
10 |
This function formats the given date as specified |
11 |
This function subtracts two dates |
12 |
This function extracts the date part of a date or datetime expression |
13 |
This function subtracts two dates |
14 |
This function retrieves the day of the month from the given date |
15 |
This function returns the name of the weekday |
16 |
This function returns the day of the month (1-31) |
17 |
This function returns the weekday index of the argument |
18 |
This function returns the day of the year (1-366) |
19 |
This function extracts part of a date |
20 |
This function converts a day number to a date |
21 |
This function formats date as a UNIX timestamp |
22 |
This function Extracts the hour |
23 |
This function returns the last day of the month for the argument |
24 |
Synonym for NOW() |
25 |
Synonym for NOW() |
26 |
This function creates a date from the year and day of year |
27 |
This function creates a time value from the given hours, minutes, and seconds. |
28 |
This function returns the microseconds from argument |
29 |
This function returns the minute from the argument |
30 |
This function returns the month from the date passed |
31 |
This function returns the name of the month |
32 |
This function returns the current date and time |
33 |
This function adds a period to a year-month |
34 |
This function returns the number of months between periods |
35 |
This function returns the quarter from a date argument |
36 |
This function converts seconds to ”HH:MM:SS” format |
37 |
This function returns the second (0-59) |
38 |
This function converts a string to a date |
39 |
This function subtracts the specified interval to a date value |
40 |
This function subtracts the specified time interval to a date time or, time value |
41 |
This function returns the time at which the function executes |
42 |
This function formats the given date in the specified format |
43 |
This function returns the argument converted to seconds |
44 |
This function extracts the time portion of the expression passed |
45 |
This function subtracts two time values |
46 |
With a single argument, this function returns the date or datetime expression. With two arguments, the sum of the arguments |
47 |
This function adds an interval to a datetime expression |
48 |
This function subtracts an interval from a datetime expression |
49 |
This function returns the date argument converted to days |
50 |
This function returns a UNIX timestamp |
51 |
This function returns the current UTC date |
52 |
This function returns the current UTC time |
53 |
This function returns the current UTC date and time |
54 |
This function returns the week number |
55 |
This function returns the weekday index |
56 |
This function returns the calendar week of the date (1-53) |
57 |
This function returns the year |
58 |
This function returns the year and week |
59 |
This function converts the date or date-time values into seconds and returns the result. |