首页 > 编程知识 正文

js显示当前时间,js获取昨天的日期

时间:2023-05-05 11:28:21 阅读:16673 作者:2379

var time=new Date (;

time.getYear (; //获得当前年份time.getFullYear (; //完整的年份(4位,1970-? (time.getMonth ); //当前月份(0- 11,0,0表示1月) time.getDate ); //当前日期(1-31 ) time.getDay ); //当前星期x (0- 6,0为星期日) time.getTime ); //当前时间(自1970.1.1起的毫秒数) time.getHours ); //当前小时数(0-23 ) time.getMinutes ); //当前分数(0-59 ) time.getSeconds ); //当前秒数(0-59 ) time.getMilliseconds ); //当前毫秒数(0-999 ) time.toLocaleDateString ); //获取当前日期var my time=time.tolocaletimestring (; //获取当前时间time.toLocaleString (; //获取日期和时间var timestamp=date.parse (new date () ) )//获取当前时间戳

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。