Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- How to blend adsense inside your post?
- PHP: add a download as pdf file button in report page
- Formatting my post
- PHPWind-- A PHP forum script applcaition in China
- Notepad++ - Add C++ compiler
- PHP connect IBM db2 database in XAMPP
- Datatable export excel wraptext and newline
- phpexcel toggle expand and hide column in EXCEL and summary
- Sweet Alert JS library - beautiful replacement of JavaScript Alert
- ActionScript 3.0 demo: create a falling snow in flash CS6
Tuesday, November 20, 2012
MySQL Date and Time Type
MySQL Date and Time Type: YEAR, TIME, DATE, DATETIME, TIMESTAMP
1.YEAR type
Both string and number are fine.
As a 4-digit string in the range '1901' to '2155'.
As a 4-digit number in the range 1901 to 2155.
Note: Out of the range 1901 to 2155 converted to 0000
2. MySQL Time Type
HH:MM:SS
or
D HH:MM:SS
Here D is day converted to hour D+24*HH
Where HH hours, MM minutes, SS seconds
3.MySQL DATE Type
YYYY-MM-DD
Where YYYY years, MM Months, DD days.
4. MySQL DATETIME Type
YYYY-MM-DD HH:MM:SS
Where YYYY years, MM Months, DD days,
HH hours, MM minutes, SS seconds
5.MySQL DATESTAMP Type
YYYY-MM-DD HH:MM:SS
Where YYYY years, MM Months, DD days,
HH hours, MM minutes, SS seconds
Similar to DATETIME,
small difference, NULL and CURRENT_TIMESTAMP are current time
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment