64
64
select date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND);
65
65
date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)
66
1998-01-01 00:00:00.000000
67
67
select date_add("1997-12-31 23:59:59",INTERVAL 1 MINUTE);
68
68
date_add("1997-12-31 23:59:59",INTERVAL 1 MINUTE)
69
1998-01-01 00:00:59.000000
70
70
select date_add("1997-12-31 23:59:59",INTERVAL 1 HOUR);
71
71
date_add("1997-12-31 23:59:59",INTERVAL 1 HOUR)
72
1998-01-01 00:59:59.000000
73
73
select date_add("1997-12-31 23:59:59",INTERVAL 1 DAY);
74
74
date_add("1997-12-31 23:59:59",INTERVAL 1 DAY)
75
1998-01-01 23:59:59.000000
76
76
select date_add("1997-12-31 23:59:59",INTERVAL 1 MONTH);
77
77
date_add("1997-12-31 23:59:59",INTERVAL 1 MONTH)
78
1998-01-31 23:59:59.000000
79
79
select date_add("1997-12-31 23:59:59",INTERVAL 1 YEAR);
80
80
date_add("1997-12-31 23:59:59",INTERVAL 1 YEAR)
81
1998-12-31 23:59:59.000000
82
82
select date_add("1997-12-31 23:59:59",INTERVAL "1:1" MINUTE_SECOND);
83
83
date_add("1997-12-31 23:59:59",INTERVAL "1:1" MINUTE_SECOND)
84
1998-01-01 00:01:00.000000
85
85
select date_add("1997-12-31 23:59:59",INTERVAL "1:1" HOUR_MINUTE);
86
86
date_add("1997-12-31 23:59:59",INTERVAL "1:1" HOUR_MINUTE)
87
1998-01-01 01:00:59.000000
88
88
select date_add("1997-12-31 23:59:59",INTERVAL "1:1" DAY_HOUR);
89
89
date_add("1997-12-31 23:59:59",INTERVAL "1:1" DAY_HOUR)
90
1998-01-02 00:59:59.000000
91
91
select date_add("1997-12-31 23:59:59",INTERVAL "1 1" YEAR_MONTH);
92
92
date_add("1997-12-31 23:59:59",INTERVAL "1 1" YEAR_MONTH)
93
1999-01-31 23:59:59.000000
94
94
select date_add("1997-12-31 23:59:59",INTERVAL "1:1:1" HOUR_SECOND);
95
95
date_add("1997-12-31 23:59:59",INTERVAL "1:1:1" HOUR_SECOND)
96
1998-01-01 01:01:00.000000
97
97
select date_add("1997-12-31 23:59:59",INTERVAL "1 1:1" DAY_MINUTE);
98
98
date_add("1997-12-31 23:59:59",INTERVAL "1 1:1" DAY_MINUTE)
99
1998-01-02 01:00:59.000000
100
100
select date_add("1997-12-31 23:59:59",INTERVAL "1 1:1:1" DAY_SECOND);
101
101
date_add("1997-12-31 23:59:59",INTERVAL "1 1:1:1" DAY_SECOND)
102
1998-01-02 01:01:00.000000
103
103
select date_sub("1998-01-01 00:00:00",INTERVAL 1 SECOND);
104
104
date_sub("1998-01-01 00:00:00",INTERVAL 1 SECOND)
105
1997-12-31 23:59:59.000000
106
106
select date_sub("1998-01-01 00:00:00",INTERVAL 1 MINUTE);
107
107
date_sub("1998-01-01 00:00:00",INTERVAL 1 MINUTE)
108
1997-12-31 23:59:00.000000
109
109
select date_sub("1998-01-01 00:00:00",INTERVAL 1 HOUR);
110
110
date_sub("1998-01-01 00:00:00",INTERVAL 1 HOUR)
111
1997-12-31 23:00:00.000000
112
112
select date_sub("1998-01-01 00:00:00",INTERVAL 1 DAY);
113
113
date_sub("1998-01-01 00:00:00",INTERVAL 1 DAY)
114
1997-12-31 00:00:00.000000
115
115
select date_sub("1998-01-01 00:00:00",INTERVAL 1 MONTH);
116
116
date_sub("1998-01-01 00:00:00",INTERVAL 1 MONTH)
117
1997-12-01 00:00:00.000000
118
118
select date_sub("1998-01-01 00:00:00",INTERVAL 1 YEAR);
119
119
date_sub("1998-01-01 00:00:00",INTERVAL 1 YEAR)
120
1997-01-01 00:00:00.000000
121
121
select date_sub("1998-01-01 00:00:00",INTERVAL "1:1" MINUTE_SECOND);
122
122
date_sub("1998-01-01 00:00:00",INTERVAL "1:1" MINUTE_SECOND)
123
1997-12-31 23:58:59.000000
124
124
select date_sub("1998-01-01 00:00:00",INTERVAL "1:1" HOUR_MINUTE);
125
125
date_sub("1998-01-01 00:00:00",INTERVAL "1:1" HOUR_MINUTE)
126
1997-12-31 22:59:00.000000
127
127
select date_sub("1998-01-01 00:00:00",INTERVAL "1:1" DAY_HOUR);
128
128
date_sub("1998-01-01 00:00:00",INTERVAL "1:1" DAY_HOUR)
129
1997-12-30 23:00:00.000000
130
130
select date_sub("1998-01-01 00:00:00",INTERVAL "1 1" YEAR_MONTH);
131
131
date_sub("1998-01-01 00:00:00",INTERVAL "1 1" YEAR_MONTH)
132
1996-12-01 00:00:00.000000
133
133
select date_sub("1998-01-01 00:00:00",INTERVAL "1:1:1" HOUR_SECOND);
134
134
date_sub("1998-01-01 00:00:00",INTERVAL "1:1:1" HOUR_SECOND)
135
1997-12-31 22:58:59.000000
136
136
select date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1" DAY_MINUTE);
137
137
date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1" DAY_MINUTE)
138
1997-12-30 22:59:00.000000
139
139
select date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1:1" DAY_SECOND);
140
140
date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1:1" DAY_SECOND)
141
1997-12-30 22:58:59.000000
142
142
select date_add("1997-12-31 23:59:59",INTERVAL 100000 SECOND);
143
143
date_add("1997-12-31 23:59:59",INTERVAL 100000 SECOND)
144
1998-01-02 03:46:39.000000
145
145
select date_add("1997-12-31 23:59:59",INTERVAL -100000 MINUTE);
146
146
date_add("1997-12-31 23:59:59",INTERVAL -100000 MINUTE)
147
1997-10-23 13:19:59.000000
148
148
select date_add("1997-12-31 23:59:59",INTERVAL 100000 HOUR);
149
149
date_add("1997-12-31 23:59:59",INTERVAL 100000 HOUR)
150
2009-05-29 15:59:59.000000
151
151
select date_add("1997-12-31 23:59:59",INTERVAL -100000 DAY);
152
152
date_add("1997-12-31 23:59:59",INTERVAL -100000 DAY)
153
1724-03-17 23:59:59.000000
154
154
select date_add("1997-12-31 23:59:59",INTERVAL 100000 MONTH);
155
155
date_add("1997-12-31 23:59:59",INTERVAL 100000 MONTH)
163
163
Warning 1441 Datetime function: datetime field overflow
164
164
select date_add("1997-12-31 23:59:59",INTERVAL "10000:1" MINUTE_SECOND);
165
165
date_add("1997-12-31 23:59:59",INTERVAL "10000:1" MINUTE_SECOND)
166
1998-01-07 22:40:00.000000
167
167
select date_add("1997-12-31 23:59:59",INTERVAL "-10000:1" HOUR_MINUTE);
168
168
date_add("1997-12-31 23:59:59",INTERVAL "-10000:1" HOUR_MINUTE)
169
1996-11-10 07:58:59.000000
170
170
select date_add("1997-12-31 23:59:59",INTERVAL "10000:1" DAY_HOUR);
171
171
date_add("1997-12-31 23:59:59",INTERVAL "10000:1" DAY_HOUR)
172
2025-05-19 00:59:59.000000
173
173
select date_add("1997-12-31 23:59:59",INTERVAL "-100 1" YEAR_MONTH);
174
174
date_add("1997-12-31 23:59:59",INTERVAL "-100 1" YEAR_MONTH)
175
1897-11-30 23:59:59.000000
176
176
select date_add("1997-12-31 23:59:59",INTERVAL "10000:99:99" HOUR_SECOND);
177
177
date_add("1997-12-31 23:59:59",INTERVAL "10000:99:99" HOUR_SECOND)
178
1999-02-21 17:40:38.000000
179
179
select date_add("1997-12-31 23:59:59",INTERVAL " -10000 99:99" DAY_MINUTE);
180
180
date_add("1997-12-31 23:59:59",INTERVAL " -10000 99:99" DAY_MINUTE)
181
1970-08-11 19:20:59.000000
182
182
select date_add("1997-12-31 23:59:59",INTERVAL "10000 99:99:99" DAY_SECOND);
183
183
date_add("1997-12-31 23:59:59",INTERVAL "10000 99:99:99" DAY_SECOND)
184
2025-05-23 04:40:38.000000
185
185
select "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
186
186
"1997-12-31 23:59:59" + INTERVAL 1 SECOND
187
1998-01-01 00:00:00.000000
188
188
select INTERVAL 1 DAY + "1997-12-31";
189
189
INTERVAL 1 DAY + "1997-12-31"
191
191
select "1998-01-01 00:00:00" - INTERVAL 1 SECOND;
192
192
"1998-01-01 00:00:00" - INTERVAL 1 SECOND
193
1997-12-31 23:59:59.000000
194
194
select date_sub("1998-01-02",INTERVAL 31 DAY);
195
195
date_sub("1998-01-02",INTERVAL 31 DAY)
197
197
select date_add("1997-12-31",INTERVAL 1 SECOND);
198
198
date_add("1997-12-31",INTERVAL 1 SECOND)
199
1997-12-31 00:00:01.000000
200
200
select date_add("1997-12-31",INTERVAL 1 DAY);
201
201
date_add("1997-12-31",INTERVAL 1 DAY)
869
872
select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND);
870
873
date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND)
874
0049-12-31 23:59:59.000000
872
875
select date_sub("0199-01-01 00:00:01",INTERVAL 2 SECOND);
873
876
date_sub("0199-01-01 00:00:01",INTERVAL 2 SECOND)
877
0198-12-31 23:59:59.000000
875
878
select date_add("0199-12-31 23:59:59",INTERVAL 2 SECOND);
876
879
date_add("0199-12-31 23:59:59",INTERVAL 2 SECOND)
880
0200-01-01 00:00:01.000000
878
881
select date_sub("0200-01-01 00:00:01",INTERVAL 2 SECOND);
879
882
date_sub("0200-01-01 00:00:01",INTERVAL 2 SECOND)
883
0199-12-31 23:59:59.000000
881
884
select date_sub("0200-01-01 00:00:01",INTERVAL 1 SECOND);
882
885
date_sub("0200-01-01 00:00:01",INTERVAL 1 SECOND)
886
0200-01-01 00:00:00.000000
884
887
select date_sub("0200-01-01 00:00:01",INTERVAL 2 SECOND);
885
888
date_sub("0200-01-01 00:00:01",INTERVAL 2 SECOND)
889
0199-12-31 23:59:59.000000
887
890
select date_add("2001-01-01 23:59:59",INTERVAL -2000 YEAR);
888
891
date_add("2001-01-01 23:59:59",INTERVAL -2000 YEAR)
892
0001-01-01 23:59:59.000000
890
893
select date_sub("50-01-01 00:00:01",INTERVAL 2 SECOND);
891
894
date_sub("50-01-01 00:00:01",INTERVAL 2 SECOND)
895
2049-12-31 23:59:59.000000
893
896
select date_sub("90-01-01 00:00:01",INTERVAL 2 SECOND);
894
897
date_sub("90-01-01 00:00:01",INTERVAL 2 SECOND)
898
1989-12-31 23:59:59.000000
896
899
select date_sub("0069-01-01 00:00:01",INTERVAL 2 SECOND);
897
900
date_sub("0069-01-01 00:00:01",INTERVAL 2 SECOND)
901
0068-12-31 23:59:59.000000
899
902
select date_sub("0169-01-01 00:00:01",INTERVAL 2 SECOND);
900
903
date_sub("0169-01-01 00:00:01",INTERVAL 2 SECOND)
904
0168-12-31 23:59:59.000000