Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    3

    Unanswered: Inputting year 999

    I am using timestamp as date in database.

    By MySQL manual, date type range is 1000-01-01 to 9999-12-31.
    Is there any way to input year 999 or do I have to use int or chars manually?

    Anyone have better idea of using year 999 or before that?

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    Do you actually need to use 999 or are you using it for a default value? If default use NULL instead.

    If 999 is actually needed you probably need to use type of CHAR for your column though you wouldn't be able to do date calculations that you can with a DATE column type.

  3. #3
    Join Date
    Jan 2004
    Posts
    3
    I need to use year before 999. I was thinking I have to use CHAR for my column.
    But it seems I can insert data that is less than year 1000. I will see if this actually works.

    Thanks.

  4. #4
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    Hello,

    From the SQL manual :

    The DATETIME type is used when you need values that contain both date and time information. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MMS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. (``Supported'' means that although earlier values might work, there is no guarantee that they will.)
    So you can try it at your own risk !

    Regards,

    RBARAER

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •