: DATE_ADD : Date Time Functions MySQL TUTORIALS
Ajax
Ajax Examples
Ajax Tutorials
Scripts and Programs
Javascript
Javascript Examples Tutorials
DHTML Tutorials
Javascript References
Scripts and Programs
HTML
HTML Tutorials
HTML References
HTML DOM 0 References
HTML DOM 2 References
CSS
CSS Tutorials
CSS References
PHP
PHP Source Code
PHP References
Scripts and Programs
C#
C# Source Code
C# Examples
MySQL TUTORIALS
»
Date Time Functions
»
DATE_ADD
»
1
2
3
218.1 .
SELECT '2005-03-32' + INTERVAL 1 MONTH;
Hits: 1182
218.2 .
Date arithmetic operations require complete dates
Hits: 991
218.3 .
If the resulting date has a day that is larger than the maximum day for the new month, the day is adjusted to the maximum days in the new month.
Hits: 950
218.4 .
SELECT DATE_ADD('1999-01-01', INTERVAL 1 HOUR);
Hits: 940
218.5 .
If you add to or subtract from a date value something that contains a time part, the result is automatically converted to a datetime value.
Hits: 975
218.6 .
SELECT DATE_ADD('1992-12-31 23
Hits: 954
218.7 .
SELECT DATE_SUB('1998-01-02', INTERVAL 31 DAY);
Hits: 1046
218.8 .
SELECT DATE_ADD('1998-01-01 00
Hits: 966
218.9 .
SELECT DATE_SUB('1998-01-01 00
Hits: 1052
218.10 .
SELECT DATE_ADD('1997-12-31 23
Hits: 1100
218.11 .
SELECT DATE_ADD('1997-12-31 23
Hits: 1069
218.12 .
SELECT DATE_ADD('1997-12-31 23
Hits: 1024
218.13 .
Adding one month to start date
Hits: 1253
218.14 .
Adding one year to a date
Hits: 1082
218.15 .
Adding one month to a date
Hits: 1006
218.16 .
Adding one day to a date
Hits: 1026
218.17 .
DATE_ADD(curdate(), INTERVAL '1.1' YEAR_MONTH); (with dot)
Hits: 957
218.18 .
DATE_ADD(curdate(), INTERVAL '1-1' YEAR_MONTH); (with minus sign)
Hits: 1060
218.19 .
DATE_ADD(curdate(), INTERVAL 1.1 SECOND_MICROSECOND); (with dot)
Hits: 1109
218.20 .
DATE_ADD(curdate(), INTERVAL '1 1' DAY_HOUR);(wihtout
Hits: 1029
MySQL TUTORIALS
Date Time Functions
»
DATE_ADD
Introduction
MONTHNAME
ADDDATE
NOW
ADDTIME
PERIOD_ADD
CONVERT_TZ
PERIOD_DIFF
CURDATE
QUARTER
CURRENT_TIMESTAMP
SECOND
CURTIME
SEC_TO_TIME
DATE
SLEEP
DATEDIFF
STR_TO_DATE
DATE_ADD
SUBDATE
DATE_FORMAT
SUBTIME
DATE_SUB
SYSDATE
DAYNAME
TIME
DAYOFMONTH
TIMEDIFF
DAYOFWEEK
TIMESTAMP
DAYOFYEAR
TIMESTAMPADD
EXTRACT
TIMESTAMPDIFF
FROM_DAYS
TIME_FORMAT
FROM_UNIXTIME
TIME_TO_SEC
GET_FORMAT
TO_DAYS
HOUR
UNIX_TIMESTAMP
INTERVAL
UTC_DATE
LAST_DAY
UTC_TIME
LOCALTIME
UTC_TIMESTAMP
LOCALTIMESTAMP
WEEK
MAKEDATE
WEEKDAY
MAKETIME
WEEKOFYEAR
MICROSECOND
YEAR
MINUTE
YEARWEEK
MONTH
Aggregate Functions
Cast Functions Operators
Comparison Functions Operators
Control Flow Functions
Cursor
Data Dictionary
Data Types
Database
Date Time Functions
Encryption Compression Functions
Information Functions
Insert Update Delete
Introduction
Logic Operator
Math Numeric Functions
Miscellaneous Functions
MySQL Utilities
Privilege
Procedure Function
Regular Expressions
Select Query
String Functions
Subquery
Table
Table Join
Trigger
View