Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8332457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:43:47+00:00 2026-06-09T02:43:47+00:00

I have manually (GASP!) entered a MySQL command at the command line, and I

  • 0

I have manually (GASP!) entered a MySQL command at the command line, and I received a Warning which I cannot even begin to understand. (And before anyone says anything, yes, I KNOW: 1. Using the command line interface is not the best approach; 2. My table is NOT named “TABLE_NAME” and my column is NOT named “DateColumn” and my RecordID value is NOT really “1234”; 3. Maybe my column type should be TIMESTAMP, but for now, it’s not. Moving on….)

Attempting to enter a value for the date “July 26th, 2012 at 2:27 PM (GMT)”, I keyed:

mysql> update TABLE_NAME set DateColumn="2012-07-26 14:27:00" where RecordID="1234";

I received:

Query OK, 1 row affected, 1 warning (0.11 sec) 
Rows matched: 1  Changed: 1  Warnings: 1

So, I keyed:

mysql> show warnings;
+---------+------+-----------------------------------------------------+
| Level   | Code | Message                                             |
+---------+------+-----------------------------------------------------+
| Warning | 1264 | Out of range value for column 'DateColumn' at row 1 |
+---------+------+-----------------------------------------------------+

Weird, I thought. So I checked the table first to confirm the column (field) type:

mysql> describe TABLE_NAME;

+------------+----------+------+-----+-------------------+-------+
| Field      | Type     | Null | Key | Default           | Extra |
| DateColumn | datetime | YES  |     | NULL              |       |
+------------+----------+------+-----+-------------------+-------+

BUT the value DOES get written properly to the database, and not truncated, AFAIK:

mysql> select * from TABLE_NAME where RecordID="1234";

+-----------------------------------------------+
| RecordID | Date_Column         | BlahBlahBlah |
+----------+---------------------+--------------+
|     1234 | 2012-07-26 14:27:00 | something..  | 
+----------+---------------------+--------------+

I’ve already searched StackOverflow.com for a solution. I’ve already Googled for an explanation. I’ve already read up at http://dev.mysql.com/doc/refman/5.5/en/datetime.html where it says:

    MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. 

I even had a slight suspicion that it had something to do with the date or time at which I was making the entry; so I will state that the server on which the database is located is on Pacific Daylight Time (GMT-8, except right now GMT-7 for DST); I am logged in (SSH) from a client on EDT (which should not matter); and I am storing all Date_Column values as GMT. At the time I was entering the value “2012-07-26 14:27:00” all three dates were well AFTER that, on 7/30/12. Not that it should matter — I should be able to enter future dates without getting an error — but thought it might be helpful for you to know. So —

WHY, OH WHY is “2012-07-26 14:27:00” an Out-of-Range Value?

My MySQL client API version is 5.1.49.

This is the first time I’ve ever posted on StackOverflow. Thank you in advance for your suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:43:50+00:00Added an answer on June 9, 2026 at 2:43 am

    I wonder if it is converting it to some date format from string. That dateformat would then have too much precision which would be truncated. Try casting it to a datetime before assigning.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which I create manually (a lot of JavaScript in it...).
I have an application in which I have manually uploaded videos using Youtube Data
I have been writing command-line Python scripts for a while, but recently I felt
I'd rather not have to manually add semicolons to every line. Specs: Aquamacs 2.1
Do I have to manually run date command using child_process and fetch the result
Where I am: Linux command line The problem I have now: Sometimes I couldn't
In my table I have looked manually and found that the top three idle
Is there a way that I manually have a user look up the current
I have a number of manually written scripts (.sql) for tables, views and stored
I have researched how to manually include a PlaceHolder Text in UITextView (as there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.