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
- PHPWind-- A PHP forum script applcaition in China
- How to blend adsense inside your post?
- Formatting my post
- Notepad++ - Add C++ compiler
- Install PHPMailer 5.2.4 and use smtp gmail
- Set up a child account and set screen time limit in Windows 8
- Wayback Machine - see archived versions of web pages across time
- phpexcel toggle expand and hide column in EXCEL and summary
- Install PHP ibm_db2 extension in Linux (redHat)
- PHP: add a download as pdf file button in report page
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