일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Oracle
- String Function and Operators
- 오라클
- 방화벽
- Data and Time Functions
- Date and Time Functions
- Date and Time Function
- Sring Functions and Operators
- 전자정부 표준프레임워크
- SVN
- Tibero
- HTTP
- 윈도우
- 전자정부표준프레임워크
- MySQL
- 티베로
- String Functions and Operators
- String Functions and Date Operators
- Today
- Total
웹이야기
MySQL TIMESTAMP() 본문
MySQL 날짜함수, 시간함수
TIMESTAMP()
- argument에 대한 datetime 값을 return, argument가 2개인경우는 더해서 datetime 값을 return.
TIMESTAMP(expr), TIMESTAMP(expr1, expr2)
의 형태
With a single argument, this function returns the date or datetime expression expr as a datetime value. With two arguments, it adds the time expression expr2 to the date or datetime expression expr1 and return the result as a datetime value.
mysql> SELECT TIMESTAMP(NOW());
+---------------------+
| TIMESTAMP(NOW()) |
+---------------------+
| 2020-04-04 10:14:51 |
+---------------------+
1 row in set (0.00 sec)
mysql> SELECT TIMESTAMP('2020-04-02');
+-------------------------+
| TIMESTAMP('2020-04-02') |
+-------------------------+
| 2020-04-02 00:00:00 |
+-------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIMESTAMP('2020-04-02 23:00:00');
+----------------------------------+
| TIMESTAMP('2020-04-02 23:00:00') |
+----------------------------------+
| 2020-04-02 23:00:00 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIMESTAMP('2002-12-21 12:00:00', '12:00:00') ;
+----------------------------------------------+
| TIMESTAMP('2002-12-21 12:00:00', '12:00:00') |
+----------------------------------------------+
| 2002-12-22 00:00:00 |
+----------------------------------------------+
1 row in set (0.00 sec)
'D > MySQL' 카테고리의 다른 글
MySQL TIMESTAMPDIFF() (0) | 2020.04.04 |
---|---|
MySQL TIMESTAMPADD() (0) | 2020.04.04 |
MySQL TIMEDIFF() (0) | 2020.04.03 |
MySQL TIME() (0) | 2020.04.03 |
MySQL SYSDATE() (0) | 2020.04.03 |