MySQL Functions on Date and Time

Q

Where to find reference information and tutorials on MySQL database functions on Date and Time? I want to know how to use ADDDATE(), DATEDIFF() and other date and time value related functions.

✍: FYIcenter.com

A

Here is a collection of reference information and tutorials on MySQL database functions on Date and Time compiled by FYIcenter.com DBA team.

ADDDATE() - Synonym for DATE_ADD()

ADDTIME() - Adding Time

CONVERT_TZ() - Converting Time Zone

CURDATE() - Current Date

CURRENT_DATE() - Synonym for CURDATE()

CURRENT_TIME() - Synonym for CURTIME()

CURRENT_TIMESTAMP() - Synonym for NOW()

CURTIME() - Current Time

DATE() - Extracting Date

DATEDIFF() - Difference of Two Dates

DATE_ADD() - Adding Date/Time Interval

DATE_FORMAT() - Formatting Date

DATE_SUB() - Decrementing Date/Time

DAY() - Synonym for DAYOFMONTH()

DAYNAME() - Name of Weekday

DAYOFMONTH() - Day of Month

DAYOFWEEK() - Day of Week (1=Sunday)

DAYOFYEAR() - Day of Year

EXTRACT() - Extracting Datetime Component

FORMAT_PICO_TIME() - Formatting Picoseconds in Readable Units

FROM_DAYS() - Converting Days to Date

FROM_UNIXTIME() - Unix Time to Datetime

GET_FORMAT() - Standard Datetime Formats

HOUR() - Hours of Time

LAST_DAY() - Last Day of Month

LOCALTIME() - Synonym for NOW()

LOCALTIMESTAMP() - Synonym for NOW()

MAKEDATE() - Making Date from Days

MAKETIME() - Making Time from Components

MICROSECOND() - Microseconds of Time

MINUTE() - Minutes of Time

MONTH() - Month of Year

MONTHNAME() - Name of Month

NOW() - Start Time of Execution

PERIOD_ADD() - Adding Months to Period

PERIOD_DIFF() - Difference of Year-Month Periods

QUARTER() - Quarter of Year

SECOND() - Seconds of Time

SEC_TO_TIME() - Converting Seconds to Time

STR_TO_DATE() - Parsing String to Datetime

SUBDATE() - Synonym for DATE_SUB()

SUBTIME() - Subtracting Time

SYSDATE() - Current Timestamp

TIME() - Extracting Time

TIMEDIFF() - Difference of Two Timestamps

TIMESTAMP() - Adding Time to Timestamp

TIMESTAMPADD() - Incrementing Timestamp

TIMESTAMPDIFF() - Difference in Timestamp Component

TIME_FORMAT() - Formatting Time

TIME_TO_SEC() - Converting Time to Seconds

TO_DAYS() - Converting Date to Days

TO_SECONDS() - Converting Datetime to seconds

UNIX_TIMESTAMP() - Calculating Unix Timestamp

UTC_DATE() - Current UTC Date

UTC_TIME() - Current UTC Time

UTC_TIMESTAMP() - Current UTC Timestamp

WEEK() - Week of Year

WEEKDAY() - Weekday (0=Monday)

WEEKOFYEAR() - Calendar Week of Year

YEAR() - Year of Date

YEARWEEK() - Year Week Combination

 

ADDDATE() - Synonym for DATE_ADD()

TRUNCATE() - Truncating to Decimal Place

⇑⇑ MySQL Function References

2023-11-16, 253🔥, 0💬