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 8024365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:51:03+00:00 2026-06-04T22:51:03+00:00

I have a mySQL table with a date recorded from various different Time Zones.

  • 0

I have a mySQL table with a date recorded from various different Time Zones. How can I convert the DateTime value to the viewing user TimeZone while doing a SELECT statement in mySQL ?

    SELECT ClientID,
        convert_tz(MessageDate,???,???)
        MeetingType,
        MeetingDate,
        Comments,
        CompanyName
    FROM clientCompNotes
    WHERE ClID = 970392281 AND CompanyID=411972145

The problem is to accept any timezone from the date recorded in the “MessageDate” field, which looks like this

 Wed May 30 2012 12:51:02 GMT-0400 (Eastern Daylight Time)

Many thanks

Dennis

  • 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-04T22:51:04+00:00Added an answer on June 4, 2026 at 10:51 pm

    You shouldn’t need to do this. MySQL will perform timezone conversion for you, provided that you store your times in TIMESTAMP type columns and that you set the session time_zone variable appropriately. As stated in the manual:

    The MySQL server maintains several time zone settings:

    […]

    • Per-connection time zones. Each client that connects has its own time zone setting, given by the session time_zone variable. Initially, the session variable takes its value from the global time_zone variable, but the client can change its own time zone with this statement:

      mysql> SET time_zone = timezone;

    The current session time zone setting affects display and storage of time values that are zone-sensitive. This includes the values displayed by functions such as NOW() or CURTIME(), and values stored in and retrieved from TIMESTAMP columns. Values for TIMESTAMP columns are converted from the current time zone to UTC for storage, and from UTC to the current time zone for retrieval.

    The current time zone setting does not affect values displayed by functions such as UTC_TIMESTAMP() or values in DATE, TIME, or DATETIME columns. Nor are values in those data types stored in UTC; the time zone applies for them only when converting from TIMESTAMP values. If you want locale-specific arithmetic for DATE, TIME, or DATETIME values, convert them to UTC, perform the arithmetic, and then convert back.

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

Sidebar

Related Questions

I have a datetime field in my MySql table where the date and time
I have a MySQL table where there is a 'date_added' (date) field, 'time_added' (time)
I have a mysql table with fields for a start and end date/time. How
I have a mysql table that contains a date field in epoch time format.
I have a MySQL table with two fields called date and time which are
I have a MySQL table: myTable {Int id, Int value, Date date} I wish
I have a MySQL table with 5 rows: email message_id date time And I
I have this mysql table: DATE | VALUE and I wish to become a
I have a mysql table with entries like this: id name value date 1
I have a (MySQL) table with two date/time fields: start and end (each of

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.