


Solution to the problem that ie8 does not support new Date (2012-11-10)_javascript skills
May 16, 2016 pm 05:27 PMWe also encountered such a problem when using JS. Later, after modification, the following code is available in the IE8 environment.
js end time-start time, get the number of days
function getDays(strDateStart,strDateEnd){
var strSeparator = "-"; //Date separator
var oDate1;
var oDate2;
var iDays;
oDate1= strDateStart .split(strSeparator);
oDate2= strDateEnd.split(strSeparator);
var strDateS = new Date(oDate1[0], oDate1[1]-1, oDate1[2]);
var strDateE = new Date(oDate2[0], oDate2[1]-1, oDate2[2]);
iDays = parseInt(Math.abs(strDateS - strDateE ) / 1000 / 60 / 60 /24)//Difference Convert milliseconds to days
return iDays ;
}

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to create and name a file/folder based on current timestamp

PHP Warning: date() expects parameter 2 to be long, string given solution

Introduction to methods and usage of using Date and SimpleDateFormat classes to process time in Java

What are the options for calendar and date libraries in Python?

How to get the millisecond representation of a date using the getTime() method of the Date class

How to solve the problem of springboot configuring date field to return timestamp

How to solve the incompatibility prompt of vue ie8

How to use Stringbuild, Date and Calendar classes in Java
