Table of Contents
This guide covers function handles date // time in SQL - part 2 with practical context and easy-to-follow details. Use it to understand the subject and apply the information confidently.
There are 2 types of ADDDATE functions:
- ADDDATE (date, interval expr unit)
- ADDDATE (expr, day)
1. ADDDATE (expr, day)
Add a certain amount of time to the passed time parameter.
- Expr: the Amount of time you want to change.
- Day: An integer number you want to add to the expr expression.
mysql> SELECT ADDDATE('2019-01-02', 31); +---------------------------------------------------------+ | ADDDATE('2019-01-02', 31) | +---------------------------------------------------------+ | 2019-02-02 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
2. ADDDATE (date, interval expr unit)
When the second argument is called INTERVAL, ADDDATE () Has the same Function asDATE_ADD () .
Example function DATE_ADD used like this:
mysql> SELECT DATE_ADD('2019-01-02', INTERVAL 31 DAY); +---------------------------------------------------------+ | DATE_ADD('2019-01-02', INTERVAL 31 DAY) | +---------------------------------------------------------+ | 2019-02-02 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
And ADDDATE has the same function:
ADDTIME () In SQL has the form: ADDTIME (expr1, expr2).
This function adds Expr2 to Expr1 And returns the result Expr1 Is a Time or Datetime Expression , While Expr2 Is a Time Expression .
mysql> SELECT ADDTIME('2018-12-31 23:59:59.999999','1 1:1:1.000002'); +---------------------------------------------------------+ | DATE_ADD('2018-12-31 23:59:59.999999','1 1:1:1.000002') | +---------------------------------------------------------+ | 2019-01-02 01:01:01.000001 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
CONVERT_TZ () In SQL is of the form: CONVERT_TZ (dt, from_tz, to_tz) .
This function is used to convert the Datetime Value dt From the time zone From_tz to The time zone To_tz And return the result CONVERT_TZ () Returns NULL If the arguments are invalid.
Example 1:
mysql> SELECT CONVERT_TZ('2019-01-01 12:00:00','GMT','MET'); +---------------------------------------------------------+ | CONVERT_TZ('2019-01-01 12:00:00','GMT','MET') | +---------------------------------------------------------+ | 2019-01-01 13:00:00 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
Example 2:
mysql> SELECT CONVERT_TZ('2019-01-01 12:00:00','+00:00','+10:00'); +---------------------------------------------------------+ | CONVERT_TZ('2019-01-01 12:00:00','+00:00','+10:00') | +---------------------------------------------------------+ | 2019-01-01 22:00:00 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
CURDATE () In SQL returns the current date in the format ' YYYY-MM-DD ' or YYYYMMDD, Depending on whether the function is being used in the string or numeric context.
mysql> SELECT CURDATE(); +---------------------------------------------------------+ | CURDATE() | +---------------------------------------------------------+ | 2019-03-15 | +---------------------------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT CURDATE() + 0; +---------------------------------------------------------+ | CURDATE() + 0 | +---------------------------------------------------------+ | 20190315 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
CURRENT_DATE or CURRENT_DATE () In SQL returns the current date in the format ' YYYY-MM-DD ' or YYYYMMDD, Depending on the function being used in the string or numeric context.
This function is similar to CURDATE () .
mysql> SELECT CURRENT_DATE; +---------------------------------------------------------+ | CURRENT_DATE | +---------------------------------------------------------+ | 2019-03-15 | +---------------------------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT CURRENT_DATE() + 1; +---------------------------------------------------------+ | CURRENT_DATE() + 1 | +---------------------------------------------------------+ | 20190316 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
CURTIME () In SQL returns the current time as the value of ' HH: MM: SS ' or HHMMSS, Depending on whether the function is being used in the string or numeric context.
mysql> SELECT CURTIME(); +---------------------------------------------------------+ | CURTIME() | +---------------------------------------------------------+ | 14:50:26 | +---------------------------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT CURTIME() + 0; +---------------------------------------------------------+ | CURTIME() + 0 | +---------------------------------------------------------+ | 145026 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The CURRENT_TIME or CURRENT_TIME () function In SQL returns the current time as the value of ' HH: MM: SS ' or HHMMSS, Depending on whether the function is being used in the string or numeric context.
This function is similar to CURTIME ().
The CURRENT_TIMESTAMP or CURRENT_TIMESTAMP () function In SQL returns the current Datetime As a value in the format ' YYYY-MM-DD HH: MM: SS ' or YYYYMMDHHMMSS, Depending on whether the function is being used in a good string context number.
This function is similar to NOW ().
mysql> SELECT CURRENT_TIMESTAMP; +---------------------------------------------------------+ | CURRENT_TIMESTAMP | +---------------------------------------------------------+ | 2019-03-15 07:36:12 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
DATE () In SQL is of the form: DATE (expr).
The DATE () function Returns the date part of the Expr Expression in the Date or Datetime form that Is passed.
mysql> SELECT DATE('2019-12-31 01:02:03'); +---------------------------------------------------------+ | DATE('2019-12-31 01:02:03') | +---------------------------------------------------------+ | 2019-12-31 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
DATEDIFF () In SQL has the form: DATEDIFF (expr1, expr2).
This function returns the difference between two time values based on the specified time period Expr1 And Expr2. These two time values must be expressions in Date or Datetime Forms . Calculate only the day portion of the values used in the calculation.
mysql> SELECT DATEDIFF('2019-12-31 23:59:59','2019-12-30'); +---------------------------------------------------------+ | DATEDIFF('2019-12-31 23:59:59','2019-12-30') | +---------------------------------------------------------+ | 1 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
mysql> SELECT DATEDIFF('2019-01-12 23:59:59','2019-02-12 23:59:59'); +---------------------------------------------------------+ | DATEDIFF('2019-01-12 23:59:59','2019-02-12 23:59:59') | +---------------------------------------------------------+ | -31 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
DATE_ADD () In SQL has the form: DATE_ADD (date, INTERVAL expr unit).
The function DATE_ADD () is Used to perform arithmetic operations with '+' arithmetic on date.
- The Date Parameter is a DATE or DATETIME Value that specifies the initial time.
- The parameter Expr Is an expression that defines the value of the time period added to the original Date , Expr Is a string; It can start with a '-' for negative time periods.
- Unit Is a keyword that indicates the units in the expression that will be interpreted.
The INTERVAL Keyword and Unit are Not case sensitive.
The following table shows the format of the Expr Argument for each Unit Value .
VALUE UNIT EXPR FORMAT MICROSECOND MICROSECOND - Micro seconds SECOND SECOND - Second MINUTE MINUTE - Minutes HOUR HOUR - Hour DAY DAY - WEEK WEEK - MONTH MONTH Week - Month QUARTER QUARTER - YEAR YEAR - Year SECOND_MICROSECOND 'SECOND. MICROSECOND' - Seconds. Micro seconds MINUTE_MICROSECOND 'MINUTE. MICROSECOND' - MinutesMicro MINUTE_SECOND 'MINUTE: SECOND' - Minutes: Second HOUR_MICROSECOND 'HOUR. MICROSECOND' - Hour. Micro HOUR_SECOND 'HOUR: MINUTES: SECOND' - Hours: Minutes: Second HOUR_MINUTE 'HOUR: MINUTE' - Hour: Minutes DAY_MICROSECOND 'DAY. MICROSECOND' - Date. Mic second DAY_SECOND 'DAY HOUR: MINUTE: SECOND' - Date & Time: Minutes: Second DAY_MINUTE 'DAY HOUR: MINUTE' - Date Time: Minutes DAY_HOUR 'DAY HOUR' - Date and Time YEAR_MONTH 'YEAR-MONTH' - Year-Month
Values of QUARTER And WEEK Start from MySQL Version 5. 0. 0 .
mysql> SELECT DATE_ADD('2019-12-31 23:59:59', INTERVAL '1:1' MINUTE_SECOND); +---------------------------------------------------------+ | DATE_ADD('2019-12-31 23:59:59', INTERVAL. | +---------------------------------------------------------+ | 2020-01-01 00:01:00 | +---------------------------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT DATE_ADD('2019-01-01', INTERVAL 1 HOUR); +---------------------------------------------------------+ | DATE_ADD('2019-01-01', INTERVAL 1 HOUR) | +---------------------------------------------------------+ | 2019-01-01 01:00:00 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
DATE_SUB () In SQL takes the form: DATE_SUB (date, INTERVAL expr unit).
The DATE_SUB () function is Used to perform the subtraction of '-' arithmetic on date.
- The Date Parameter is a DATE or DATETIME Value that specifies the initial time.
- The parameter Expr Is an expression that defines the value of the time period minus the original date, Expr Is a string; it can start with a '-'.
- Unit Is a keyword that indicates the units in the expression that will be interpreted.
The INTERVAL Keyword and Unit are Not case sensitive.
The format of the Expr Argument for each unit value is similar to the Function DATE_ADD () .
Values of QUARTER And WEEK Start from MySQL Version 5. 0. 0.
mysql> SELECT DATE_SUB('2019-06-15', INTERVAL -10 DAY); +---------------------------------------------------------+ | SELECT DATE_SUB('2019-06-15', INTERVAL -10 DAY); | +---------------------------------------------------------+ | 2019-06-25 | +---------------------------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT DATE_SUB('2019-12-31 23:59:59', INTERVAL '1:1' MINUTE_SECOND); +---------------------------------------------------------+ | DATE_SUB('2019-12-31 23:59:59', INTERVAL. | +---------------------------------------------------------+ | 2019-12-31 23:58:58 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
DATE_FORMAT () In SQL takes the form: DATE_FORMAT (date, format) Used to format the Date Value in the Format String .
Below are the specifiers that can be used in the Format String . The character '%' is required before these specifier characters.
SpecifierExplanation % a Abbreviated name (Sun. Sat)% b Abbreviated month name (Jan. Dec)% c Month, numeric value (0. 12)% D Date by count (0th, 1st, 2nd, 3rd, .)% d Day of the month, numeric value (00. 31)% e Day of the month, numeric value (0. 31)% f Microsecond (000000. 999999)% H Hour, value format (00. 23)% h Hour, value form (01. 12)% I Hour, value form (01. 12)% i Minutes, numeric value ( 00. 59)% j Year of the year (001. 366)% k Hour, value form (0. 23)% l Hour, value form (1. 12)% M Month name (January. December)% m Month, numeric value format (00. 12)% p AM or PM% r Time, 12h (hh: mm: ss is followed by AM or PM)% S Seconds (00. 59) % s Seconds (00. 59)% T Time, 24h (hh: mm: ss)% U Week of the year (00. 53), with Sunday being the first day of the week% u Week of the year (00. .53), with Monday being the first day of the week % V Week of the year (01. 53), with Sunday being the first day of the week; used with% X% v Week of the year (01. 53), with Monday being the first day of the week; used with% x% W Weekday name (Sunday. Saturday)% w Day of the week, numeric form (0 = Sunday. 6 = Saturday)% X Year for the week, with Sunday being the first day of the week, 4-digit value; used with% V% x Year for the week, with Monday being the first day of the week, 4-digit value; used with% v% Y Year, 4-digit value% y Year, 2-digit value %% A character constant%. % x For any. X. Which is not listed above
For example:
mysql> SELECT DATE_FORMAT('2019-10-04 22:23:00', '%H %k %I %r %T %S %w'); +---------------------------------------------------------+ | DATE_FORMAT('2019-10-04 22:23:00.. | +---------------------------------------------------------+ | 22 22 10 10:23:00 PM 22:23:00 00 5 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
mysql> SELECT DATE_FORMAT('2019-10-04 22:23:00', '%W %M %Y'); +---------------------------------------------------------+ | DATE_FORMAT('2019-10-04 22:23:00', '%W %M %Y') | +---------------------------------------------------------+ | Saturday October 2019 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
DAY () In SQL is in the form: DAY (date) .
The DAY () function Returns the date in the month from the passed Date , between 0 and 31.
mysql> SELECT DAY('2019-06-15'); +---------------------------------------------------------+ | DAY('2019-06-15') | +---------------------------------------------------------+ | 15 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
This function is similar to DAYOFMONTH ().
DAYNAME () In SQL takes the form: DAYNAME (date).
The DAYNAME () function Returns the name of the day of the week of the passed Date .
mysql> SELECT DAYNAME('2019-03-15'); +---------------------------------------------------------+ | DAYNAME('2019-03-15') | +---------------------------------------------------------+ | Friday | +---------------------------------------------------------+ 1 row in set (0.00 sec)
DAYOFMONTH () In SQL is in the form: DAYOFMONTH (date).
The DAYOFMONTH () function Returns the date in the month from the passed Date , between 0 and 31.
mysql> SELECT DAYOFMONTH('2019-06-15'); +---------------------------------------------------------+ | DAYOFMONTH('2019-06-15') | +---------------------------------------------------------+ | 15 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
This function is similar to DAY ().
DAYOFWEEK () In SQL is in the form: DAYOFWEEK (date).
The DAYOFWEEK () function Returns the day of the week (1 = Sunday, 2 = Monday. 7 = Saturday). These index values correspond to the ODBC standard.
mysql> SELECT DAYOFWEEK('2019-03-15'); +---------------------------------------------------------+ |DAYOFWEEK('2019-03-15') | +---------------------------------------------------------+ | 6 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
DAYOFYEAR () In SQL takes the form: DAYOFYEAR (date).
The DAYOFYEAR () function Returns the serial number of the day passed in the year between 1 and 366.
mysql> SELECT DAYOFYEAR('2019-03-15'); +---------------------------------------------------------+ | DAYOFYEAR('2019-03-15') | +---------------------------------------------------------+ | 74 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
EXTRACT () In SQL has the form: EXTRACT (unit FROM date).
The EXTRACT () function Uses the same unit specifiers as the DATE_ADD () And DATE_SUB () functions , but it extracts parts from Date Rather than performing arithmetic operations on Date.
mysql> SELECT EXTRACT(YEAR_MONTH FROM '2019-03-15 01:02:03'); +---------------------------------------------------------+ | EXTRACT(YEAR_MONTH FROM '2019-03-15 01:02:03') | +---------------------------------------------------------+ | 201903 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
mysql> SELECT EXTRACT(YEAR FROM '2019-03-15'); +---------------------------------------------------------+ | EXTRACT(YEAR FROM '2019-03-15') | +---------------------------------------------------------+ | 2019 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
FROM_DAYS () In SQL is of the form: FROM_DAYS (N)
This function is used to convert N Numbers into a specific Date Value FROM_DAYS () is Only used with Gregorian calendar dates (1582).
mysql> SELECT FROM_DAYS(737498); +---------------------------------------------------------+ | FROM_DAYS(737498) | +---------------------------------------------------------+ | 2019-03-15 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
FROM_UNIXTIME () In SQL is of the form: FROM_UNIXTIME (unix_timestamp, [format]).
Unix Time (Unix timestamp) is a system for expressing a point on the time axis, according to the time axis it uses the number of seconds to determine the time, with the original point from 00: 00: 00 on January 1 / 1970 UTC hour.
For example: At 00: 00: 00 - 12/02/2016 the timestamp value is 1455235200; It means that from 00: 00 to 1/1/1970 to 00: 00: 00 - 12/02/2016 is 1455235200 seconds.
The FROM_UNIXTIME () function Returns the representative date of the Unix_timestamp Argument as a value in the format 'YYYY-MM-DD HH: MM: SS' or YYYYMMDDHHMMSS Depending on whether the function is being used in the string or numeric context.
The value is shown in the current time zone. The Unix_timestamp Argument can be created by TheUNIX_TIMESTAMP ()Function .
mysql> SELECT FROM_UNIXTIME(1552688580); +---------------------------------------------------------+ | FROM_UNIXTIME(1552688580) | +---------------------------------------------------------+ | 2019-03-15 22:23:00 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
If the Format Parameter is passed, the result will be formatted according to the Format String listed similar to The DATE_FORMAT () function .
mysql> SELECT FROM_UNIXTIME(1552688580, '%W %M %Y'); +---------------------------------------------------------+ | FROM_UNIXTIME(1552688580, '%W %M %Y') | +---------------------------------------------------------+ | Friday March 2019 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The HOUR () function In SQL has the form: HOUR (time) Returns the time from the Time Passed. The return value is in the range from 0 to 23 for the time of day value.
mysql> SELECT HOUR('10:05:03'); +---------------------------------------------------------+ | HOUR('10:05:03') | +---------------------------------------------------------+ | 10 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The LAST_DAY () function In SQL is in the form: LAST_DAY (date).
This function has the passed parameter as the Date or Datetime Value , which Returns the corresponding value for the last day of the month. The output will be NULL if the parameter is invalid.
mysql> SELECT LAST_DAY('2019-03-15'); +---------------------------------------------------------+ | LAST_DAY('2019-03-15') | +---------------------------------------------------------+ | 2019-03-31 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
LOCALTIME or LOCALTIME () Returns the current Datetime As a value in the format ' YYYY-MM-DD HH: MM: SS ' or YYYYMMDHHMMSS, Depending on whether the function is being used in the string or numeric context.
This function is similar to NOW ().
mysql> SELECT LOCALTIME(); +---------------------------------------------------------+ | LOCALTIME() | +---------------------------------------------------------+ | 2019-03-15 09:53:17 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The LOCALTIMESTAMP or LOCALTIMESTAMP () function Returns the current Datetime As a value in the format 'YYYY-MM-DD HH: MM: SS' or YYYYMMDHHMMSS, Depending on whether the function is being used in the string or numeric context.
This function is similar to NOW ().
mysql> SELECT LOCALTIMESTAMP; +---------------------------------------------------------+ | LOCALTIMESTAMP | +---------------------------------------------------------+ | 2019-03-15 10:12:12 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
MAKEDATE () In SQL is in the form: MAKEDATE (year, dayofyear) .
This function returns a date with the Year Parameter and the Dayofyear Passed. The Dayofyear Value must be greater than zero or the result will be NULL.
mysql> SELECT MAKEDATE(2019,31); +---------------------------------------------------------+ | MAKEDATE(2019,31) | +---------------------------------------------------------+ | 2019-01-31 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
mysql> SELECT MAKEDATE(2019,122); +---------------------------------------------------------+ | MAKEDATE(2019,122) | +---------------------------------------------------------+ | 2019-05-02 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
MAKETIME () function In SQL has the form: MAKETIME (hour, minute, second) , returns a Time Value from the transmitted Hour, minute, And Second Parameters.
mysql> SELECT MAKETIME(12,15,30); +---------------------------------------------------------+ | MAKETIME(12,15,30) | +---------------------------------------------------------+ | '12:15:30' | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The MICROSECOND () function In SQL is in the form of MICROSECOND (expr) and Returns a Microsecond From the time expression (expr) In the form of a number between 0 and 999999.
mysql> SELECT MICROSECOND('12:00:00.123456'); +---------------------------------------------------------+ | MICROSECOND('12:00:00.123456') | +---------------------------------------------------------+ | 123456 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The MINUTE () function In SQL has the form: MINUTE (time) , which returns the minute value from the passed Time Parameter, between 0 and 59.
mysql> SELECT MINUTE('19-03-15 10:05:03'); +---------------------------------------------------------+ | MINUTE('19-03-15 10:05:03') | +---------------------------------------------------------+ | 5 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The MONTH () function In SQL is in the form: MONTH (date) , returning the month from the passed Date Parameter, between 0 and 12.
mysql> SELECT MONTH('2019-02-12') +---------------------------------------------------------+ | MONTH('2019-02-12') | +---------------------------------------------------------+ | 2 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The MONTHNAME () function In SQL is in the form MONTHNAME (date) , returning the month name of the passed Date Parameter.
mysql> SELECT MONTHNAME('2019-02-12'); +---------------------------------------------------------+ | MONTHNAME('2019-02-12') | +---------------------------------------------------------+ | February | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The NOW () function In SQL returns the current Datetime As a value in the format ' YYYY-MM-DD HH: MM: SS' or YYYYMMDHHMMSS, Depending on whether the function is being used in the string or numeric context. The result of the function is the time in the current time zone.
mysql> SELECT NOW(); +---------------------------------------------------------+ | NOW() | +---------------------------------------------------------+ | 2019-03-15 16:50:26 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
PERIOD_ADD () In SQL is of the form PERIOD_ADD (P, N) .
This function adds the number of months ( N ) specified at a time interval ( P ) P Transmits in YYMM or YYYYMM Format and returns the value in YYYYMM Format .
mysql> SELECT PERIOD_ADD(1901,2); +---------------------------------------------------------+ | PERIOD_ADD(1901,2) | +---------------------------------------------------------+ | 201903 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
mysql> SELECT PERIOD_ADD(201901,2); +---------------------------------------------------------+ | PERIOD_ADD(201901,2) | +---------------------------------------------------------+ | 201903 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
PERIOD_DIFF () In SQL takes the form: PERIOD_DIFF (P1, P2).
This function returns the number of months between the P1 And P2 Periods passed in YYMM or YYYYMM Format .
mysql> SELECT PERIOD_DIFF(1902,201803); +---------------------------------------------------------+ | PERIOD_DIFF(1902,201803) | +---------------------------------------------------------+ | 11 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
The QUARTER () function In SQL in the form QUARTER (date) Returns the quarter in the year the Date Is passed, between 1 and 4.
mysql> SELECT QUARTER('19-04-01'); +---------------------------------------------------------+ | QUARTER('19-04-01') | +---------------------------------------------------------+ | 2 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
SECOND () function In SQL has the form SECOND (time) Returns the second value from the Time Parameter passed in, between 0 and 59.
mysql> SELECT SECOND('10:05:03'); +---------------------------------------------------------+ | SECOND('10:05:03') | +---------------------------------------------------------+ | 3 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
SEC_TO_TIME () In SQL is of the form: SEC_TO_TIME (second) .
This function returns the value converted from the Second Parameter to the hour, minute, and second format ' HH: MM: SS ' or HHMMSS, Depending on whether the function uses string or number.
mysql> SELECT SEC_TO_TIME(1202); +---------------------------------------------------------+ | SEC_TO_TIME(1202) | +---------------------------------------------------------+ | 00:20:02 | +---------------------------------------------------------+ 1 row in set (0.00 sec)
FAQ
What should I check before following these steps?
Confirm device and software compatibility, save important data, and make sure you have the required permissions, files, and account access.
Why might the process not work?
Common causes include outdated software, missing permissions, incompatible hardware, an unstable connection, or completing a step in the wrong order.
Can I undo the changes if necessary?
That depends on the tool or setting. Use built-in restore options when available, keep a backup, and record the original configuration first.
Reader Comments 0
Sign in with email or Google to join the discussion.