<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    Chapter 6:  MySQL Language Reference 395 YEAR 0000    The \zero" values are special, but you can store or refer to them explicitly using the values shown in the table.  You can also do this using the values '0' or 0, which are easier to write.    \Zero" date or time values used through  MyODBC  are converted automatically to  NULL in MyODBC Version 2.50.12 and above, because ODBC can't handle such values. 6.2.2.1  Y2K Issues and Date Types MySQL itself is Y2K-safe (see Section 1.2.5 [Year 2000 compliance], page 9), but input values presented to MySQL may not be.  Any input containing 2-digit year values is ambiguous, because the century is unknown.  Such values must be interpreted into 4-digit form because MySQL stores years internally using four digits. For DATETIME, DATETIMESTAMP, and YEAR types, MySQL interprets dates with ambiguous year values using the following rules:    Year values in the range 00-69 are converted to 2000-2069.    Year values in the range 70-99 are converted to 1970-1999. Remember  that  these  rules  provide  only  reasonable  guesses  as  to  what  your  data  mean. If  the  heuristics  used  by  MySQL  don't  produce  the  correct  values,  you  should  provide unambiguous input containing 4-digit year values. ORDER BY  will sort 2-digit  YEAR/DATE/DATETIME  types properly. Note also that some functions like MIN() and MAX() will convert a TIMESTAMP/DATE to a number.  This means that a timestamp with a 2-digit year will not work properly with these functions.  The x in this case is to convert the TIMESTAMP/DATE to 4-digit year format or use something like MIN(DATE_ADD(timestamp,INTERVAL 0 DAYS)). 6.2.2.2  The DATETIMEDATE, and TIMESTAMP Types The DATETIME, DATE, and TIMESTAMP types are related.  This section describes their char- acteristics, how they are similar, and how they di er. The DATETIME type is used when you need values that contain both date and time infor- mation.   MySQL retrieves  and displays  DATETIME  values  in  'YYYY-MM-DD HH:MM:SS'  for- mat.  The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.  (\Sup- ported"  means  that  although  earlier  values  might  work,  there  is  no  guarantee  that  they will.) The  DATE  type  is  used  when  you  need  only  a  date  value,  without  a  time  part.   MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format.  The supported range is '1000- 01-01' to '9999-12-31'. The TIMESTAMP column type provides a type that you can use to automatically mark INSERT or  UPDATE  operations  with  the  current  date  and  time.   If  you  have  multiple  TIMESTAMP columns, only the rst one is updated automatically. Automatic updating of the rst TIMESTAMP column occurs under any of the following con- ditions:
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide