当前位置: 移动技术网 > IT编程>开发语言>Jsp > jsp用代码将CST格式的时间转换为GTM格式的时间

jsp用代码将CST格式的时间转换为GTM格式的时间

2018年09月14日  | 移动技术网IT编程  | 我要评论

用代码将cst格式的时间转换为gtm格式的时间

 $scope.datetogmt=function(strdate){
         var datestr=strdate.split(" ");
         var strgmt = datestr[0]+" "+datestr[1]+" "+datestr[2]+" "+datestr[5]+" "+datestr[3]+" gmt+0800";
         var date = new date(date.parse(strgmt));
         return strgmt;
     }
     $scope.comparetime=function () {
         var gmtbegintime=$scope.datetogmt('${vote.begintime}');

         var timestampbegin = date.parse(gmtbegintime);//转为时间戳
         var timstampnow=date.parse(new date());//转为时间戳
         timestampbegin = timestampbegin / 1000;
         timstampnow = timstampnow / 1000;
       

     }

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网