🌐
MySQL
dev.mysql.com › doc › en › date-and-time-types.html
MySQL :: MySQL 8.4 Reference Manual :: 13.2 Date and Time Data Types
The date and time data types for representing temporal values are DATE, TIME, DATETIME, TIMESTAMP, and YEAR. Each temporal type has a range of valid values, as well as a “zero” value that may be used when you specify an invalid value that MySQL cannot represent.
🌐
W3Schools
w3schools.com › mysql › mysql_dates.asp
MySQL Date Functions
String Functions ASCII CHAR_LENGTH CHARACTER_LENGTH CONCAT CONCAT_WS FIELD FIND_IN_SET FORMAT INSERT INSTR LCASE LEFT LENGTH LOCATE LOWER LPAD LTRIM MID POSITION REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SPACE STRCMP SUBSTR SUBSTRING SUBSTRING_INDEX TRIM UCASE UPPER Numeric Functions ABS ACOS ASIN ATAN ATAN2 AVG CEIL CEILING COS COT COUNT DEGREES DIV EXP FLOOR GREATEST LEAST LN LOG LOG10 LOG2 MAX MIN MOD PI POW POWER RADIANS RAND ROUND SIGN SIN SQRT SUM TAN TRUNCATE Date Functions ADDDATE ADDTIME CURDATE CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP CURTIME DATE DATEDIFF DATE_ADD DATE_FORMAT DATE_
Discussions

Is it a good idea to use string data type for dates in MySQL instead of using datetime data type? - Stack Overflow
While implementing web applications on top of MySQL database, I'm thinking if it is a good idea to just use string data type to store dates? For example, I can just store dates as '201110191503999... More on stackoverflow.com
🌐 stackoverflow.com
Date Data Type Question
MySQL supports partial date values like 1949-00-00 and 1951-11-00 MySQL permits you to store dates where the day or month and day are zero. This is convenient if you want to store a birthdate in a DATE column and you know only part of the date. -- https://dev.mysql.com/doc/refman/8.4/en/using-date.html however, i recommend using three separate columns -- SMALLINT, TINYINT, TINYINT -- which can hold zeros as required More on reddit.com
🌐 r/SQL
6
August 15, 2024
Reddit’s database has only two tables

Alright, let's correct some things here.

First, as many have pointed out, the blog post is quoting an article from 2010 - and that article is paraphrasing a presentation Steve gave. I'd recommend at least looking at the rest of the 2010 article - it gives some context for the use of postgres as a key-value store rather than just a relational store.

Video presentation starting at the schema discussion

Next, we've got more than just two tables. The quote/paraphrase doesn't make it clear, but we've got two tables per thing. That means Accounts have an "account_thing" and an "account_data" table, Subreddits have a "subreddit_thing" and "subreddit_data" table, etc.

EDIT: To add as a final point, the context of the video is "Steve's lessons from building reddit." These are lessons about bootstrapping a startup; you don't necessarily have the time or funds to hire a DBA or to have a perfect DB; and running a data migration when you're NOT a DBA but rather, just trying to get new features out there and working so you can become profitable is not necessarily the best use of your engineering time. You just need something that works for your needs, as you grow. And yes, that means you have to be aware of the shortcomings of your data store as you grow, and be prepared to do something "better" in time - for some applications, that means, well, hiring a DBA and doing it right. For reddit, it meant caching the hell out of everything.

More on reddit.com
🌐 r/programming
354
1084
July 15, 2011
what is the reason there is no boolean data type in mysqli bind_param() ?
Yes! There's no true boolean datatype in MySql: BOOL , BOOLEAN These types are synonyms for TINYINT(1) . A value of zero is considered false. Nonzero values are considered true: More on reddit.com
🌐 r/PHP
22
5
June 1, 2018
🌐
GeeksforGeeks
geeksforgeeks.org › mysql › mysql-date-data-type
MySQL DATE Data Type - GeeksforGeeks
July 23, 2025 - MySQL DATE Data Type stores date values in the format 'YYYY-MM-DD' and has a valid range of values from '1000-01-01' to '9999-12-31'.
🌐
Navicat
navicat.com › en › company › aboutus › blog › 1884-working-with-dates-and-times-in-mysql-part-1
Working with Dates and Times in MySQL - Part 1
February 25, 2022 - To do that, you can use the MySQL DATETIME type. By default, DATETIME values range from 1000-01-01 00:00:00 to 9999-12-31 23:59:59. When you query data from a DATETIME column, MySQL displays the DATETIME value in the same YYYY-MM-DD HH:MM:SS format.
🌐
Database Star
databasestar.com › mysql-date
MySQL Date Data Types and Date Functions | Database Star: Home
August 13, 2020 - DATETIME and TIMESTAMP can store fractional seconds up to 6 decimal places. When displaying data in these data types, the formats of the display are: ... MySQL will convert a TIMESTAMP value from the current time zone into UTC time zone when it's stored in the database and will convert it back to the current time zone when it's retrieved.
🌐
O'Reilly
oreilly.com › library › view › mysql-in-a › 0596007892 › apas04.html
A.4. Date and Time Datatypes - MySQL in a Nutshell [Book]
May 3, 2005 - Date and Time DatatypesThere are a few column datatypes for storing date and time values. They are listed in Table A-3. The table also lists the valid ranges for each datatype. If a... - Selection from MySQL in a Nutshell [Book]
Author   Russell J. T. Dyer
Published   2005
Pages   352
🌐
GeeksforGeeks
geeksforgeeks.org › mysql › datetime-vs-timestamp-data-type-in-mysql
DATETIME vs TIMESTAMP Data Type in MySQL? - GeeksforGeeks
July 23, 2025 - The TIMESTAMP data type stores date and time information in the format YYYY-MM-DD HH:MM:SS as well, but it is influenced by the timezone settings of the MySQL server.
Find elsewhere
🌐
MySQL
dev.mysql.com › doc › en › datetime.html
MySQL :: MySQL 8.4 Reference Manual :: 13.2.2 The DATE, DATETIME, and TIMESTAMP Types
The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD hh:mm:ss' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. The TIMESTAMP data type is used for values that contain both date ...
🌐
MySQL
dev.mysql.com › doc › refman › 8.4 › en › date-and-time-type-syntax.html
MySQL :: MySQL 8.4 Reference Manual :: 13.2.1 Date and Time Data Type Syntax
The date and time data types for representing temporal values are DATE, TIME, DATETIME, TIMESTAMP, and YEAR. For the DATE and DATETIME range descriptions, “supported” means that although earlier values might work, there is no guarantee. MySQL permits fractional seconds for TIME, DATETIME, ...
🌐
Dataedo
dataedo.com › kb › query › mysql › find-all-date-and-time-columns
Find all date and time columns in MySQL database - MySQL Data Dictionary Queries
January 28, 2019 - Date and time in MySQL are represented by following data types: date, time, datetime, year, timestamp.
🌐
MySQL Tutorial
mysqltutorial.org › home › mysql basics › mysql datetime data type
MySQL DATETIME Data Type
December 28, 2023 - MySQL DATETIME data type allows you to store a value that contains both date and time.
🌐
Work at Tech
workat.tech › core-cs › tutorial › date-and-time-datatype-in-mysql-9503yvlkdyt5
Datatypes in MySQL - III | DATE, TIME, DATETIME, TIMESTAMP
April 27, 2022 - MySQL provides a DATE and TIME data type for storing date and time values. Learn more about the same in this article.
🌐
MySQL
dev.mysql.com › doc › refman › 9.4 › en › datetime.html
MySQL :: MySQL 9.4 Reference Manual :: 13.2.2 The DATE, DATETIME, and TIMESTAMP Types
The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD hh:mm:ss' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. The TIMESTAMP data type is used for values that contain both date ...
🌐
DevArt
blog.devart.com › home › products › mysql tools › mysql date format: understanding date, time, and datetime in mysql
MySQL Date Format Guide: Queries, Functions & Examples
April 23, 2025 - Some store only dates, others track exact timestamps, and a few adjust for time zones automatically. Here’s how they compare: The DATE data type stores calendar dates in YYYY-MM-DD format, supporting values from 1000-01-01 to 9999-12-31 in ...
🌐
MySQL
dev.mysql.com › doc › en › data-types.html
MySQL :: MySQL 8.4 Reference Manual :: 13 Data Types
MySQL supports SQL data types in several categories: numeric types, date and time types, string (character and byte) types, spatial types, and the JSON data type. This chapter provides an overview and more detailed description of the properties of the types in each category, and a summary of the data type storage requirements.
🌐
W3Schools
w3schools.com › sql › sql_dates.asp
Date Functions in SQL Server and MySQL
The most difficult part when working with dates in databases, is to be sure that the format of the date you are trying to insert/select, matches the format of the date column in the database. Different SQL databases have various data types to store date and time values.
🌐
MySQL Tutorial
mysqltutorial.org › home › mysql basics › mysql date data type
MySQL DATE Data Type
December 27, 2023 - MySQL DATE is one of the five temporal data types used for managing date values. MySQL uses yyyy-mm-dd format for storing a date value.
🌐
PlanetScale
planetscale.com › mysql for developers › schema › dates
Dates — MySQL for Developers — PlanetScale
November 8, 2023 - When it comes to storing time-related data in MySQL, it's essential to choose the right data type based on your needs. The DATE, DATETIME, and TIMESTAMP data types are the most commonly used, with TIMESTAMP being the most compact and efficient ...
🌐
MySQL
dev.mysql.com › doc › en › date-and-time-literals.html
MySQL :: MySQL 8.4 Reference Manual :: 11.1.3 Date and Time Literals
MySQL uses the type keywords and the ODBC constructions to produce DATE, TIME, and DATETIME values, respectively, including a trailing fractional seconds part if specified. The TIMESTAMP syntax produces a DATETIME value in MySQL because DATETIME has a range that more closely corresponds to the standard SQL TIMESTAMP type, which has a year range from 0001 to 9999.