Good day to all, such a problem - copied data from one database (1) to another database (2), and in database 1, the time is different for + 3h., The number of rows in table 120 and for everyone is different by +3 hours, as replace in base 2 time with the right time zone? Thank.

    1 answer 1

    update table set date_column=date_column-1/8 

    1/8 is the difference in days, i.e. 1/24 * 3

    • can you please an example for +2 thanks - Ethernets
    • one
      @Ethernets -1/12 course :) in fact, no one bothers to write directly with a formula that would not be considered 1/24 * 2 - Mike
    • Earned, thanks a lot;) - Ethernets
    • and if in winter +2 and summer 3 how to do? - Ethernets
    • one
      @Ethernets Time Zone in the data itself is not stored. The data is interpreted in the belt that was in the database / session settings at the time of entering the values ​​into the database and at the time of their receipt from the database. So we simply modify the value itself in the hope that the session settings do not change. If your data floats here and there, it may be worth watching the settings ... Or think about your time interpretation mechanisms. And then add instead of subtraction - just replace the sign ... - Mike