1. datetime( Mm / DD / yyyy HHM / S )

Format :‘YYY-MM-DD HH:MM:SS’.

Occupy :8 byte

Range :1000-01-01 00:00:00 To 9999-12-31 23:59:59.

tip: You can receive any separator date , It is mainly to judge whether the date is correct , Is it in the right range .

however , Non generic separators have poor readability , Not recommended :

tip: Share in the current year 2 When the number of digits represents , Regulations 70~99 representative 1979~1999, and 00~69 representative 2000~2069.

If you only give the date of , I didn't write the hours, minutes and seconds , Then the time, minute and second part defaults to 00:00:00.

Support 0 value : There is no regulation at present .

2013-04-0 Express 4 The whole month .

2. date( Specific date )

3. timestamp( Time stamp )

When the storage , Integer. ; But when it comes to expressing , Is similar to datetime type .

Occupy :4 byte

Range :1970-01-01 00:00:00 To 2038-01-19 03:14:07( Affected by the size of integers )

When inserting time beyond the above range , It will report an error and cannot be inserted correctly .

tip: When retrieving columns , +0 You can retrieve the timestamp :

MySQL: More articles on date types

  1. mysql Date type comparison

    MySQL The date type : Date format . Storage space occupied . Date range Compare .  The date type         Storage space        Date format                  Date range  ------------ ------ ...

  2. turn MySQL Date type details

    MySQL The date type : Date format . Storage space occupied . Date range Compare .  The date type         Storage space        Date format                  Date range   ------------ ---- ...

  3. MySQL Date type and default settings ( except timestamp Out of type , The system does not support setting default values for other time type fields )

    MySQL Date type and default settings I was using MySQL newly build table, There were some problems creating date type columns , Now it's sorted out for reference . MySQL How to set the current time to its default value ? answer : Please use time ...

  4. java mysql The date type

    mysql( edition :5.1.50) The time and date types of are as follows : datetime 8bytes xxxx-xx-xx xx:xx:xx 1000-01-01 00:00:00 To 9999-12-31 23:59: ...

  5. Mysql Date type size comparison --- Pull records for a given period of time

    We know ,mysql inside , There are many forms of date types ,date, datetime,timestamp Other types . Consider a scenario like this : Pull the content of a given time period by time period , At this time , We have to use the date type comparison . Table structure ...

  6. mysql The date type

    The date type DATE TIME DATETIME TIMESTAMP YEAR effect : Store user registration time , Article release time , The employee's entry time , time of birth , Expiration time, etc. YEAR YYYY(1901/2155) DAT ...

  7. mysql Date type default '0000-00-00' Fault tolerant processing

    mysql Date default '0000-00-00' To blame .net even mysql Database time , If a field in the table is date type and the value is ‘0000-00-00’ when , Will report a mistake . stay C# The date can't be like that . Maybe it's the difference in the definition of the minimum date ...

  8. MySQL Date type function and use

    1 MySQL There are five data types related to date and time in the database , The space occupied by various date data types is shown in the figure below : 2 datetime And date datetime Occupy 8 byte , It's the most space consuming date format . It shows the date ...

  9. LocalDateTime And mysql Date type interaction ( be based on mybatis)

    as everyone knows , In entity Entity Inside , have access to Java.sql.Date.java.sql.Timestamp.java.util.Date To map to the database date.timestamp.datetime etc. ...

Random recommendation

  1. Git Tutorial recommendation

    recommend : Liao Xuefeng's official website -Git course , For beginners , simple .

  2. Apache Commons Series introduction And Pool

    One . summary Apache Commons Pool The library provides a complete set of API, And a number of object pool implementations with their own characteristics .2.0 edition , It's not right 1.x Simple upgrade , It's an implementation of a fully rewritten object pool , Significant improvement ...

  3. WinDbg The command trilogy :( One )WinDbg Command manuals

    This paper is about Dennis Gao Original technical articles , Published in blog Park , No reprint in any form without permission of the author . Series of blog posts <WinDbg The command trilogy :( One )WinDbg Command manuals > <WinDb ...

  4. jQuery Validate Plug in validation ,, Return different information (json remote) Customize

    problem To apply for an account, you need to confirm that the account exists jquery.validate.js Medium remote Jquery Ajax Get the Json After the data , Add custom validation Their thinking : Enter the login information to verify the account remotely ...

  5. Delphi - Be free and at leisure , Write your own Timer play ( Multithreading Timer)

    I'll take the train tomorrow , get home , There's nothing to do today , I was trying to get components from other programs across processes , Such as ListView,ListBox,Button And so on , All of a sudden, I have an idea to write my own Timer, no need SetTimer function , Our own ...

  6. python And decode、encode And codecs modular

    One . Let's talk about encoding and decoding first Code conversion , It is usually necessary to unicode As an intermediate code , That is, decoding other encoded strings first (decode) become unicode, Again from unicode code (encode) Into another code . Eg: str ...

  7. Linear programming and network flow 24 topic ●09 How to get the number of squares &amp;13 The problem of interstellar transfer

    ●( do codevs1908 when , It was found that the test data also covered 1907, I want to do it together , But because “ technology ” poor , All morning ) ●09 How to get the number of squares (codevs1907  Take the number of squares 3) I thought about it for a long time. , I didn't build the map : But ...

  8. windows Next mongodb Basic play series introduction and installation

    windows Next mongodb Basic play series windows Next mongodb Basic play series introduction and installation windows Next mongodb Basic play series 2 CURD operation ( establish . to update . Read and delete ) windows Next ...

  9. React Router Basic course

    React It's a technology stack , Use alone React It's hard to build complex Web Applications , In many cases, we need to introduce other related technologies React Router yes React The routing Library of , Keep relevant page parts and URL The synchronization between the Let's make it simple ...

  10. Android File system compilation error record

    error 1: Be careful :external/protobuf/java/src/main/java/com/google/protobuf/GeneratedMessageLite.java Used without inspection or without ...