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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:54:55+00:00 2026-05-29T17:54:55+00:00

I have a little, but nasty problem: I have a database with many records,

  • 0

I have a little, but nasty problem:

I have a database with many records, every record has two fields with mysql timestamps, like this:
2012-02-14 11:09:59

and since every row has it’s individual timezone (i saved the timezone as string, such as “Europe/Berlin” and also as offset like +1 in a float field), i have a little problem:

I want to query the db for records that are newer or older than -now-
I could convert the date to GMT and search them with the servers tmz-offset.
Easy, buuuuttt, the trouble is, i want to have the possibility to search for records that happen at a certain local time, like for instance:

I want to search for a thing that happens at 22:00 tomorrow all over the world.
Now if i convert all timestamps to GMT i could not do that, because in the where condition 22:00 is not going to be the local time, but the GMT-time…
Is there any way i could combine the timestamp and the tmz field in one query?

Thanks 1000 in advance!

  • 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-29T17:54:56+00:00Added an answer on May 29, 2026 at 5:54 pm

    I think the ideal solution would be either to

    • Store all times in UTC and do the offset calculations when outputting the date

    • or have a second, separate column with the UTC date.

    However, your original requirement should be possible as well – use DATE_ADD() to calculate the correct offset:

    SELECT DATE_ADD(event_time, INTERVAL event_time_offset HOUR) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem. I had some JComboBox to a JDialog but they
i have a little problem, i'm searching, but i can't found what i need,
I have a strong database background but very little practical experience with ms sql
We have a nasty little problem. In short we can detect if a screen
I have developed a website, using Twitter API. Now a little but important problem
I have a little problem..but im goin' to crazy... In the html i have
I have little problem in my iPhone application code but can not identify. please
I have a little Problem but don't know the Solution! I have wrote a
I have a little but annoying problem. I have made an app where the
Well i have a little problem but really strange. So basically i analyzed URL

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.