本文介绍了最新chrome版本中的日期时间转换未命中匹配(67.0.3396.87(官方版本)(64位))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我从Controller返回jsonresult,在输出时间就像/ Date(-2209152600000)/我正在使用我提到的函数转换这个格式: 函数ConvertDate(jsondate){ if(jsondate!= null&& jsondate!=){ var getdate = jsondate; var convertedDate = new Date(getdate); if(convertedDate =='Invalid Date'){ var milli = getdate.replace(/ \ / Date \(( - ?\\\ +)\)\ //,'$ 1'); convertedDate = new Date(parseInt( milli)); } return convertedDate; } else { 返回; } } 问题是此功能在Mozilla和Internet Explorer中返回正确的日期和时间,但在Chrome最新更新中它给出了我从控制器输出返回的时间少了9分钟 我尝试过: 函数ConvertDate(jsondate){ if(jsondate!= null&& jsondate!=){ var getdate = jsondate; var convertedDate = new Date(getdate); if(convertedDate == '无效日期'){ var milli = getdate.replace(/ \ / Date \(( - ?\d +)\)\ //,'$ 1'); convertedDate = new Date(parseInt(milli)); } return convertedDate; } else { 返回; } } 这个函数在chrome浏览器以外给出了正确的时间,早些时候它也正常工作但是我的客户升级了chrome版本之后只有问题开始了解决方案 1'); convertedDate = new Date(parseInt(milli)); } return convertedDate; } else { 返回; } } 问题是此函数返回正确的日期和t我在Mozilla和互联网资源管理器,但在Chrome最新更新它给我从控制器输出返回的时间少9分钟 我尝试过什么: 函数ConvertDate(jsondate){ if(jsondate!= null&& jsondate!=){ var getdate = jsondate; var convertedDate = new Date(getdate); if(convertedDate == '无效日期'){ var milli = getdate.replace(/ \ / Date \(( - ?\d +)\)\ //,' 1'); convertedDate = new Date(parseInt(milli)); } return convertedDate; } else { 返回; } } 此功能在Chrome浏览器以外的时间提供正确的时间,之前它也正在使用精美的Chrome,但是我的客户升级了chrome版本之后只开始了问题 I am returning jsonresult from Controller,In the output time is coming like /Date(-2209152600000)/ and i am converting this format using the function which i mentioned bellow:function ConvertDate(jsondate) {if (jsondate != null && jsondate != "") {var getdate = jsondate;var convertedDate = new Date(getdate);if (convertedDate == 'Invalid Date') {var milli = getdate.replace(/\/Date\((-?\d+)\)\//, '$1');convertedDate = new Date(parseInt(milli));}return convertedDate;}else {return "";}}the issue is this function is returning correct date and time in Mozilla and internet explorer but in Chrome latest update it is giving 9 minutes less the time what i am returning from the controller outputWhat I have tried:function ConvertDate(jsondate) {if (jsondate != null && jsondate != "") {var getdate = jsondate;var convertedDate = new Date(getdate);if (convertedDate == 'Invalid Date') {var milli = getdate.replace(/\/Date\((-?\d+)\)\//, '$1');convertedDate = new Date(parseInt(milli));}return convertedDate;}else {return "";}}this function is giving correct time in other than chrome browser, earlier it was working fine chrome also but my clients upgraded the chrome version after that only the issue started 解决方案 1');convertedDate = new Date(parseInt(milli));}return convertedDate;}else {return "";}}the issue is this function is returning correct date and time in Mozilla and internet explorer but in Chrome latest update it is giving 9 minutes less the time what i am returning from the controller outputWhat I have tried:function ConvertDate(jsondate) {if (jsondate != null && jsondate != "") {var getdate = jsondate;var convertedDate = new Date(getdate);if (convertedDate == 'Invalid Date') {var milli = getdate.replace(/\/Date\((-?\d+)\)\//, '1');convertedDate = new Date(parseInt(milli));}return convertedDate;}else {return "";}}this function is giving correct time in other than chrome browser, earlier it was working fine chrome also but my clients upgraded the chrome version after that only the issue started 这篇关于最新chrome版本中的日期时间转换未命中匹配(67.0.3396.87(官方版本)(64位))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-12 15:05