在做常規:直接紅寶石CONVERT_TZ將返回零
select convert_tz(now(), "UTC", "Europe/London")
一個MariaDB的服務器上,它會產生:
+-------------------------------------------+
| convert_tz(now(), "UTC", "Europe/London") |
+-------------------------------------------+
| 2013-03-07 16:01:32 |
+-------------------------------------------+
但是,如果通過紅寶石1.8.7或1.9來完成。 3寬度:
q = 'select convert_tz(now(), "UTC", "Europe/London")'
ActiveRecord::Base.connection.select_all(q)
就會產生:
"convert_tz(now(), \"UTC\", \"Europe/London\")" => nil
做同樣針對MySQL的安裝:
q = 'select convert_tz(now(), "UTC", "Europe/London")'
ActiveRecord::Base.connection.select_all(q)
結果:
"convert_tz(now(), \"UTC\", \"Europe/London\")" => "2013-03-07 16:05:14"
現在MySQLWorkbench測試,相同的不良結果發生存在,則返回null的轉換時間,而不是。
所以我想這是在MariaDB或?