uibootstrap时区问题,选择日期跟传递的参数不是一个是怎么回事

丑拒 2017-04-24 11:10:04
引用了一个uibootstrap插件,我选择的日期跟往后台传递的参数不一样。
html代码:
<input type='text' class="form-control" uib-datepicker-popup="{{format}}" ng-model="register_time" is-open="popup1.opened"
ng-required="true" close-text="关闭" clear-text="清空" current-text="今天" show-button-bar="false" alt-input-formats="altInputFormats"/>
<span class="input-group-btn"><button type="button" class="btn btn-default" ng-click="open1()"><i class="glyphicon glyphicon-calendar"></i></button></span>
</div>


js代码是这样的
$scope.dat = new Date();
$scope.format = "yyyy/MM/dd";
$scope.altInputFormats = ['yyyy/M!/d!'];
$scope.popup1 = {
opened:false
}
$scope.open1 = function () {
$scope.popup1.opened =true
}


问题来了,我选择日期是4月3日。但是传递数据却是4月2日下午16:00。



目测是时区问题,但是如何解决?在js文件里面用时区更改的代码没有效果,我有点迷。请各位大神指点一二。
...全文
130 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_41998288 2018-12-25
  • 打赏
  • 举报
回复
已解决,masql配置连接配置Timezone=Asia/Shanghai
jdbc.url=jdbc\:mysql\://localhost\:3306/lost_property?useUnicode\=true&characterEncoding\=UTF-8&serverTimezone\=Asia/Shanghai&useSSL\=false

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧