일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 방화벽
- 전자정부 표준프레임워크
- SVN
- Tibero
- Data and Time Functions
- 티베로
- Sring Functions and Operators
- 오라클
- String Function and Operators
- Date and Time Function
- 전자정부표준프레임워크
- 윈도우
- Date and Time Functions
- String Functions and Operators
- Oracle
- String Functions and Date Operators
- MySQL
- HTTP
- Today
- Total
웹이야기
MySQL TIMESTAMPADD() 본문
MySQL 날짜함수, 시간함수
TIMESTAMPADD()
-
TIMESTAMPADD(unit, interval, datetime_expr)
의 형태
Adds the integer expression interval to the date or datetime expression datetime_expr. The unit for interval is given by the unit argument, which should be one of the following values: MICROSECOND(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR.
The unit value may be specified unsing on of keywords as shown, or with a prefix of SQL_TSI_.
For example, DAY and SQL_TSI_DAY both are legal.
mysql> SELECT TIMESTAMPADD(WEEK, 1, '2002-01-02');
+-------------------------------------+
| TIMESTAMPADD(WEEK, 1, '2002-01-02') |
+-------------------------------------+
| 2002-01-09 |
+-------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIMESTAMPADD(MINUTE, 1, '2002-01-02');
+---------------------------------------+
| TIMESTAMPADD(MINUTE, 1, '2002-01-02') |
+---------------------------------------+
| 2002-01-02 00:01:00 |
+---------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIMESTAMPADD(WEEK, 1, NOW());
+------------------------------+
| TIMESTAMPADD(WEEK, 1, NOW()) |
+------------------------------+
| 2020-04-11 10:26:30 |
+------------------------------+
1 row in set (0.00 sec)
'D > MySQL' 카테고리의 다른 글
MySQL TIME_FORMAT() (0) | 2020.04.04 |
---|---|
MySQL TIMESTAMPDIFF() (0) | 2020.04.04 |
MySQL TIMESTAMP() (0) | 2020.04.04 |
MySQL TIMEDIFF() (0) | 2020.04.03 |
MySQL TIME() (0) | 2020.04.03 |