---
title: "Discussion on \"MySQL的Timestamp準確度、快取應用的雷點\" | Hashnode"
description: "Discussion on \"MySQL的Timestamp準確度、快取應用的雷點\". MySQL是常用的關聯式資料庫管理系統，其中Timestamp類型是一種用來儲存日期和時間的資料類型。在定義Timestamp欄位時，如果不定義準確小數點 的話，預設只到秒，且會四捨五入。  \n比如以下的資料表定義，就明確定義了到小數點下6位也就是微秒精度。  \nCREATE TABLE `services` (  \n`id` bigint(20) NOT NULL AUTO_INCREMENT,  \n`start_time` timestamp(6) NOT NULL DEFAULT CURR..."
url: "https://hashnode.com/posts/mysqltimestamp/63f99c8831748d5bf88e7b68"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [MySQL的Timestamp準確度、快取應用的雷點](https://ebifurai.hashnode.dev/mysqltimestamp?utm_source=hashnode&utm_medium=feed)

MySQL是常用的關聯式資料庫管理系統，其中Timestamp類型是一種用來儲存日期和時間的資料類型。在定義Timestamp欄位時，如果不定義準確小數點 的話，預設只到秒，且會四捨五入。 比如以下的資料表定義，就明確定義了到小數點下6位也就是微秒精度。 CREATE TABLE \`services\` ( \`id\` bigint(20) NOT NULL AUTO\_INCREMENT, \`start\_time\` timestamp(6) NOT NULL DEFAULT CURR...

Feb 25, 2023 · 2 min read · ebifurai.hashnode.dev  
Updated Mar 2, 2023  
Read the article

-   [#mysql](https://hashnode.com/tag/mysql)
-   [#java](https://hashnode.com/tag/java)
-   [#spring-framework](https://hashnode.com/tag/spring-framework)

## Written by

[蕭從恩](https://hashnode.com/@ebifurai)

@ebifurai · Tokyo, Japan

  
[View profile](https://hashnode.com/@ebifurai)

Backend developer in Java, sometimes Kotlin.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
