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
- Using Cron Job to process PHP scripts
- job interview questions (1)
- Install PHPMailer 5.2.4 and use smtp gmail
- PHP connect IBM db2 database in XAMPP
- Set up a child account and set screen time limit in Windows 8
- PHP - Export Content to MS Word document
- Datatable export excel wraptext and newline
- Sweet Alert JS library - beautiful replacement of JavaScript Alert
- Powerful js library datable to export table in pdf, excel, sorting, freezing column and table header fixed (sticky)
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