一地纸

 找回密码
 立即注册

tag 标签: JavaScript

相关日志

JS 日期相减得出剩余天数
admin 2018-6-6 11:02
div id="myAnchor"/div script var begindate = '2018-2-15'; var enddate = '2018-3-26'; function getDateDiff(date1,date2){ var arr1=date1.split('-'); var arr2=date2.split('-'); var d1=new Date(arr1 ,arr1 ,arr1 ); var d2=new Date(arr2 ,arr2 ,arr2 ); document.getElementById('myAnchor').innerHTML=((d2.getTime()-d1.getTime())/(1000*3600*24)); } getDateDiff(begindate,enddate); /script
个人分类: JS|83 次阅读|0 个评论

QQ|一地纸 ( 闽ICP备09072999号 )

GMT+8, 2018-9-19 13:37

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部