MySQL 데이터 형식 timestamp에 대한 토론
4758 단어 Timestamp
mysql 공식 문서에는 다음과 같은 구절이 있습니다.
The TIMESTAMP data type provides a type that you can use to automatically mark INSERT or UPDATE operations with the current date and time. If you have multiple TIMESTAMP columns in a table, only the first one is updated automatically. (From MySQL 4.1.2 on, you can specify which TIMESTAMP column updates;
시간stamp 형식은 insert나 업데이트 업데이트에 따라 자동으로 업데이트된다는 뜻입니다.
다음은 실제로 하나의 사례를 테스트해 보겠습니다.
mysql> create table b(ID int ,Time timestamp);Query OK, 0 rows affected (0.01 sec)
mysql> insert into b values(1,now());Query OK, 1 row affected (0.00 sec)
mysql> insert into b values(2,now());Query OK, 1 row affected (0.01 sec)
-------------------------------------------------
mysql> select * from b;+------+---------------------+| ID | Time |+------+---------------------+| 1 | 2013-07-26 13:56:11 || 2 | 2013-07-26 13:57:43 |+------+---------------------+
------------------------------------------------
mysql> update b set id=3 where id=2;
------------------------------------------------
mysql> select * from b;+------+---------------------+| ID | Time |+------+---------------------+| 1 | 2013-07-26 13:56:11 || 3 | 2013-07-26 16:35:43 |+------+---------------------+
타임스탬프가 자동으로 업데이트되었음을 알 수 있습니다.더 많은timestamp 정보는 mysql 공식 문서를 볼 수 있습니다http://dev.mysql.com/doc/refman/4.1/en/timestamp-pre-4-1.html
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Flutter×Firebase Timestamp 날짜 및 시간 정보 표시흐름으로서는 ①Firestore의 timestamp로 시간 취득 ② 그 timestamp를 datetime으로 변경 ③ 텍스트로 표시 ① 이하의 코드로 timestamp라는 필드명으로 시간 취득 ②datetime으로...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.