Questions tagged [convert-tz]

Convert from one timezone to another (MySQL)

Convert from one timezone to another (MySQL)

Format

CONVERT_TZ(dt,from_tz,to_tz)

Examples

SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET');
SELECT CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00');

References

79 questions
0
votes
1 answer

Looking for a way to Query data from MySQL database & write it to a output txt file

Looking for a way to Query data from MySQL database & write it to a output txt file. I am trying to query a Linux server db from a remote windows box. MySQL Query: mysql -u XXX -pXXX -h ttplxapp-esm01.abc.com -D telalert -e "select…
user1486112
0
votes
2 answers

how to convert datetime from any zone to a specific zone in mysql

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,???,???) …
DKean
  • 2,017
  • 6
  • 19
  • 28
-1
votes
2 answers

MariaDB convert_tz () (copying data by converting time zone on the fly)

We are trying to copy data from database1 (DB1) to database2 (DB2) in runtime. DB1 and DB2 are on two different timezones lets say tz1 and tz2. We wish to convert DB1 Time column to tz2 while copying on the fly to DB2. We tried to use combination of…
Akshay
  • 1
  • 2
-1
votes
1 answer

Inserting a date in RFC2822 format - no timezone specifier?

I have a string in RFC2822 format and I would like to insert the appropiate timestamp in UTC time. Until now I've come up with DATE_FORMAT(?, "%a, %d %b %Y %T -0700") but the problem is the TZ offset -0700, there seems to be no format specifier for…
Flavius
  • 13,566
  • 13
  • 80
  • 126
1 2 3 4 5
6