---
title: "What is the difference between DATE, DATETIME, and TIMESTAMP?"  
description: "What is the difference between DATE, DATETIME, and TIMESTAMP?"  
author: "ICSM Computer"  
published: 2025-08-19  
updated: 2025-08-19  
canonical: https://www.mindstick.com/forum/161874/what-is-the-difference-between-date-datetime-and-timestamp  
category: "SQL Server"  
tags: ["sql server", "sql"]  
reading_time: 2 minutes  

---

# What is the difference between DATE, DATETIME, and TIMESTAMP?

**What is the [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between [DATE](https://yourviews.mindstick.com/story/3869/propose-day-2024-exciting-date-ideas-for-you-and-your-partner), [DATETIME](https://www.mindstick.com/forum/12949/how-to-validate-if-a-datetime-field-is-not-null-empty), and [TIMESTAMP](https://www.mindstick.com/interview/791/what-does-timestamp-on-update-current_timestamp-data-type-do)?**

## Replies

### Reply by Anubhav Sharma

#### Note:

- `DATE` → Only the date.
- `DATETIME` → Date + Time (no timezone conversion).
- `TIMESTAMP` → Date + Time with **timezone/UTC awareness** (in MySQL), or row versioning (in SQL Server).

#### DATE

- Stores only the **calendar date** (no time).
- Format: `YYYY-MM-DD`.
- Storage size: **3 bytes**.
- Range: `1000-01-01` to `9999-12-31`.

```plaintext
CREATE TABLE ExSampleDate (dob DATE);
INSERT INTO ExSampleDate VALUES ('2025-08-19');
SELECT dob FROM ExSampleDate ;

```

#### DATETIME

- Stores **date + time** (no timezone conversion).
- Format: `YYYY-MM-DD hh:mm:ss`.
- Storage size: **8 bytes**.
- Range: `1753-01-01 00:00:00` to `9999-12-31 23:59:59`.

```plaintext
CREATE TABLE EXSampleDateTime (created_at DATETIME);
INSERT INTO EXSampleDateTime VALUES ('2025-08-19 14:30:45');
SELECT created_at FROM EXSampleDateTime ;

```

#### TIMESTAMP (behavior differs by DBMS)

- In **MySQL**:

   - Stores **date + time** similar to `DATETIME` but in **UTC internally**.
   - Automatically updates to current time if configured with `DEFAULT CURRENT_TIMESTAMP`.
   - Format: `YYYY-MM-DD hh:mm:ss`.
   - Storage size: **4 bytes**.
   - Range: `1970-01-01 00:00:01 UTC` to `2038-01-19 03:14:07 UTC`.

- In **SQL Server** / **Oracle**, TIMESTAMP usually means a **row-versioning / sequence** number (not date-time).

## Example (MySQL)

```plaintext
CREATE TABLE EXSampleTimestamp (
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

INSERT INTO EXSampleTimestamp VALUES (DEFAULT);
SELECT updated_at FROM EXSampleTimestamp ;

```


---

Original Source: https://www.mindstick.com/forum/161874/what-is-the-difference-between-date-datetime-and-timestamp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
