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

  • Home
  • SEARCH
  • 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 6642995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:59:46+00:00 2026-05-25T23:59:46+00:00

I tried to insert a timestamp into ‘dates’ with: INSERT INTO dates VALUES (4,

  • 0

I tried to insert a timestamp into ‘dates’ with:

INSERT INTO dates VALUES (4, "2011-10-04 12:58:36 -0600")

4 is just an ID. In the table it is inserted as:

2011-10-04 12:58:36 or 0000-00-00 00:00:00

So my problem is, that the time difference -0600 is lost. How can I insert it, too?

  • 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-05-25T23:59:47+00:00Added an answer on May 25, 2026 at 11:59 pm

    You could use SUBSTR() to chop it off and CONVERT_TZ() to convert it.

    • http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr
    • http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_convert-tz

    Something like this

    INSERT INTO table_name  CONVERT_TZ(SUBSTR('2011-10-04 12:58:36 -0600',1,19),'+00:00',SUBSTR('2011-10-04 12:58:36 -0600',20));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem as I tried to create two TIMESTAMP columns in
I'm going crazy today. I just tried to insert a new record and it
I tried running the following statement: INSERT INTO VOUCHER (VOUCHER_NUMBER, BOOK_ID, DENOMINATION) SELECT (a.number,
I have a simple question. Ive got a trigger to insert the values into
I want to insert a row of data into a table with five columns
I am trying to write a query to insert a value into a timestamp
I'm trying to insert a row into a table that I've set up in
INSERT INTO `comments` ( `id`, `pid`, `comment`, `user`, `date`, `active`) VALUES ('23','3','Most Excellent! I
I'm using a mysql_query() in PHP to insert a value into a table in
I am trying to insert records into Access table from SQL Server table. For

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.