Buenas quisiera que me puedan ayudar. Estoy tratando de convertir una fecha en milisegundos, he realizado en javascript con DATE.UTC
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_utc
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display the numbers of milliseconds between a specified date and midnight January 1, 1970.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var d = Date.UTC(2015, 06, 31);
console.log(Date.UTC(2015,06,31));
console.log(Date.UTC(2015,07,31));
console.log(Date.UTC(2015,08,31));
console.log(Date.UTC(2015,09,31));
console.log(Date.UTC(2015,10,31));
console.log(Date.UTC(2015,11,31));
console.log(Date.UTC(2015,12,31));
console.log(Date.UTC(2016,01,29));
console.log(Date.UTC(2016,02,29));
console.log(Date.UTC(2016,03,31));
console.log(Date.UTC(2016,04,31));
console.log(Date.UTC(2016,05,31));
console.log(Date.UTC(2016,06,31));
console.log(Date.UTC(2016,07,31));
console.log(Date.UTC(2016,08,31));
console.log(Date.UTC(2016,09,31));
console.log(Date.UTC(2016,10,31));
console.log(Date.UTC(2016,11,31));
console.log(Date.UTC(2016,12,31));
console.log(Date.UTC(2017,01,28));
console.log(Date.UTC(2017,02,28));
console.log(Date.UTC(2017,03,31));
console.log(Date.UTC(2017,04,31));
console.log(Date.UTC(2017,05,31));
console.log(Date.UTC(2017,06,31));
console.log(Date.UTC(2017,07,31));
console.log(Date.UTC(2017,08,31));
console.log(Date.UTC(2017,09,31));
console.log(Date.UTC(2017,10,31));
console.log(Date.UTC(2017,11,31));
console.log(Date.UTC(2017,12,31));
console.log(Date.UTC(2018,01,28));
console.log(Date.UTC(2018,02,28));
console.log(Date.UTC(2018,03,31));
console.log(Date.UTC(2018,04,31));
console.log(Date.UTC(2018,05,31));
console.log(Date.UTC(2018,06,31));
console.log(Date.UTC(2018,07,31));
console.log(Date.UTC(2018,08,31));
console.log(Date.UTC(2018,09,31));
console.log(Date.UTC(2018,10,31));
console.log(Date.UTC(2018,11,31));
console.log(Date.UTC(2018,12,31));
console.log(Date.UTC(2019,01,28));
console.log(Date.UTC(2019,02,28));
console.log(Date.UTC(2019,03,31));
console.log(Date.UTC(2019,04,31));
console.log(Date.UTC(2019,05,31));
console.log(Date.UTC(2019,06,31));
console.log(Date.UTC(2019,07,31));
console.log(Date.UTC(2019,08,31));
console.log(Date.UTC(2019,09,31));
console.log(Date.UTC(2019,10,31));
console.log(Date.UTC(2019,11,31));
document.getElementById("demo").innerHTML = d;
}
</script>
</body>
</html>
y en SQL Server quisiera que me vote el mismo resultado.
SELECT cast(cast(datediff(day, '19700101', dateadd(month,-1,'20150229'))* 24 * 60 * 60 as varchar(250))+'000' as bigint)
pero al momento de realizar el numero sale diferente que la función DATE.UTC