[Java] - MySQL数据库的时间设置问题.
之前有朋友做的项目时间格式设置为String,我感觉很不好,随后自己试了试.
首先在设置数据库类型时,选择的是timestamp, 而Java的实体中设置时间的属性类型为Date, (java.util.Date);
之后试了下,存入数据库的时间,比如是MySQL的CURRENT_TIMESTAMP,但是查出来返回给easyUI的则不对.
多方调查后发现有这么一个SpringBoot的注解,非常好用.
因为时差原因,这里要+8个小时,而且时间格式在注解里说明就可以了.
怎么样,是不是很简单,赶紧动手试试吧?
用过都说好
如果程序运行报错,说你timezone有问题
则使用以下方式进行解决:
show variables like '%time_zone%'; select now(); set global time_zone = '+8:00'; flush privileges;
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAAB/CAYAAACuTp8rAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAACcQAAAnEAGUaVEZAAAAB3RJTUUH4gcBFTULssrR+QAAGnBJREFUeNrtnXmUXNV95z+/+15tvS9q7RISQhIgVhsDsZG8DTZmTLywOHEMSXxisGP7TM4wi5cJYOIY5zjxjD3xxMYmMR4MjME2jo2I2Q5bkLFYjSRkEGqpJbWkVi/qtbb37m/+uFXd1VvVKxUYZaa+59RRd9d79937fb/72+7vXkEdddRRx/8/kDe6A/NB3xKxa56CBfn1776PxyV5JcS1Av8OWACkgaPAEaAPGAKGgXBqNAoKsrVC++cIKGAKf7CF25/R/wfIO1fcgIT/AnwF8HDDDYBMgbQjwK+Ah4FtQA8wMdWIG51snSJE3wyYaUOOF/7NTRKyNTqBxyd5TvJiwE+A91e4PMBJ4kvAE8AjwPM4KS0ZqYJODrcZ+AjwwcLvtwI/BiyqyNPR+um/0UTNCQGUPHAvcD7QhJtkMWa/cB9YWvi8G7gWeBG4D/g5sB3IlxC3HPgacDlOogEuKLT7oxIlEKmbxx1KdF4MOBWn81JAR4Gk1cAJwImF3xvnaaoPeAC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NTM6MTErMDg6MDBfwPIFAAAAQ3RFWHRzb2Z0d2FyZQAvdXNyL2xvY2FsL2ltYWdlbWFnaWNrL3NoYXJlL2RvYy9JbWFnZU1hZ2ljay03Ly9pbmRleC5odG1svbV5CgAAABh0RVh0VGh1bWI6OkRvY3VtZW50OjpQYWdlcwAxp/+7LwAAABh0RVh0VGh1bWI6OkltYWdlOjpIZWlnaHQANjI1OIIruAAAABd0RVh0VGh1bWI6OkltYWdlOjpXaWR0aAAzODle4R2vAAAAGXRFWHRUaHVtYjo6TWltZXR5cGUAaW1hZ2UvcG5nP7JWTgAAABd0RVh0VGh1bWI6Ok1UaW1lADE1MzA0NTMxOTFTzsclAAAAEnRFWHRUaHVtYjo6U2l6ZQAzMDcxNUJgidX5AAAAYnRFWHRUaHVtYjo6VVJJAGZpbGU6Ly8vaG9tZS93d3dyb290L25ld3NpdGUvd3d3LmVhc3lpY29uLm5ldC9jZG4taW1nLmVhc3lpY29uLmNuL3NyYy8xMjE2MC8xMjE2MDk3LnBuZ8/nBX0AAAAASUVORK5CYII=" alt="" />
[Java] - MySQL数据库的时间设置问题.的更多相关文章
- jsp页面上读取MySQL数据库datetime时间显示问题
mysql数据库中时间字段选用了datetime,如果通过java实现在jsp页面上显示时间为"年-月-日 时:分"等格式,那么如下代码就会有不同的结果! 实体类中两个变量: p ...
- Java与数据库之间时间的处理
Java与数据库之间时间的处理 在数据库中建表: DROP TABLE IF EXISTS `times`; CREATE TABLE `times` ( `id` int(11) NOT NULL ...
- java 访问 mysql 数据库的字符集设置
mysql是在linux下,java代码通过jdbc访问总是中文乱码.做过如下尝试: 1)修改 mysql的 my.cnf文件,设置 default-character-set等参数 2) 利用alt ...
- Mysql数据库账户权限设置
1.修改mysql数据库的root密码: 修改 数据库.表名 SET password=加密(‘密码’) where user=’root’; UPDATE mysql.user SET passwo ...
- ubuntu14.04 mysql数据库允许远程访问设置
安装mysql5.5 sudo apt-get install mysql-server-5.5 --------------------------------------------------- ...
- mysql的安装、C++訪问mysql数据库、编码设置问题
一.mysql的安装.这个相对简单,直接去官网下载mysql安装程序.就能够完毕安装过程,网上有非常多安装教程,这个没什么注意事项. 二.C++訪问mysql.主要是用到mysql定义的头文件,内部定 ...
- java mysql 数据库
1. jdbc 驱动名还是数据库 String driver = "com.mysql.jdbc.Driver"; //URL指向要访问的数据库名mydataString url ...
- Spring Boot程序插入时间和MySQL数据库显示时间不一样(设置数据库时区)
首先查看数据库时区 show variables like "%time_zone%"; # 设置全局时区 mysql> set global time_zone = '+8 ...
- mysql数据库对时间进行默认的设置
//----------------------------------------------------------sql语句----------------------------------- ...
随机推荐
- oracle(五)tkprof 使用 transient kernal profile 侧面 轮廓
1.show parameter sql_trace value是false表示系统当前不会产生trace文件 2.使产生trace文件 alter session set sql_trace = t ...
- Spark会把数据都载入到内存么?
前言 很多初学者其实对Spark的编程模式还是RDD这个概念理解不到位,就会产生一些误解. 比如,很多时候我们常常以为一个文件是会被完整读入到内存,然后做各种变换,这很可能是受两个概念的误导: RDD ...
- (转)Springboot 中filter 注入对象
问题:我建立一个全局拦截器,当然,这是测试的时候建立的,我把它命名为LogFilter,它继承了Filter,web应用启动的顺序是:listener->filter->servlet,而 ...
- MVC备忘笔记
1.增加样式 @Html.EditorFor(model => model.AssociationName, new { @class="inputtext input-220&quo ...
- <A Decomposable Attention Model for Natural Language Inference>(自然语言推理)
http://www.xue63.com/toutiaojy/20180327G0DXP000.html 本文提出一种简单的自然语言推理任务下的神经网络结构,利用注意力机制(Attention Mec ...
- MFC六大核心机制之三:动态创建
MFC中很多地方都使用了动态创建技术.动态创建就是在程序运行时创建指定类的对象.例如MFC的单文档程序中,文档模板类的对象就动态创建了框架窗口对象.文档对象和视图对象.动态创建技术对于希望了解MFC底 ...
- MySQL从删库到跑路_高级(一)——数据完整性
作者:天山老妖S 链接:http://blog.51cto.com/9291927 一.数据完整性简介 1.数据完整性简介 数据冗余是指数据库中存在一些重复的数据,数据完整性是指数据库中的数据能够正确 ...
- 519. Random Flip Matrix(Fisher-Yates洗牌算法)
1. 问题 给定一个全零矩阵的行和列,实现flip函数随机把一个0变成1并返回索引,实现rest函数将所有数归零. 2. 思路 拒绝采样 (1)先计算矩阵的元素个数(行乘以列),记作n,那么[0, n ...
- 主成分分析(PCA)学习笔记
这两天学习了吴恩达老师机器学习中的主成分分析法(Principal Component Analysis, PCA),PCA是一种常用的降维方法.这里对PCA算法做一个小笔记,并利用python完成对 ...
- 隐马尔科夫模型(HMM)学习笔记二
这里接着学习笔记一中的问题2,说实话问题2中的Baum-Welch算法编程时矩阵转换有点烧脑,开始编写一直不对(编程还不熟练hh),后面在纸上仔细推了一遍,由特例慢慢改写才运行成功,所以代码里面好多处 ...