convert_tz 返回 null [英] convert_tz returns null

查看:41
本文介绍了convert_tz 返回 null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这听起来很愚蠢,但是当我使用

I know this sounds stupid, but when I use

SELECT CONVERT_TZ('2004-01-01 12:00:00','UTC','Asia/Jakarta') AS time

它输出NULL.我在 64 位 Ubuntu 12.04 中使用 MySQL Workbench,它适用于我的其他笔记本电脑/操作系统(也使用 MySQL Workbench).

it outputs NULL. I'm using MySQL Workbench in Ubuntu 12.04 64 bit, and it works in my other laptop/os (also using MySQL Workbench).

推荐答案

如果你还没有将时区表加载到 mysql 中,就会发生这种情况.

This will happen if you haven't loaded the time zone table into mysql.

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

mysql 是保存 MySQL 特定配置数据的内置数据库的名称.

mysql is the name of the built-in database that holds MySQL-specific configuration data.

这篇关于convert_tz 返回 null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆