js获取时间
来源:互联网 发布:java divide向上保留 编辑:程序博客网 时间:2024/05/29 15:16
// 今天
var
today =
new
Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
today.setMilliseconds(0);
alert(today);
var
oneday = 1000 * 60 * 60 * 24;
// 昨天
var
yesterday =
new
Date(today - oneday);
alert(yesterday);
// 上周一
var
lastMonday =
new
Date(today- oneday * (today.getDay() + 6));
alert(lastMonday);
// 上个月1号
var
lastMonthFirst =
new
Date(today - oneday * today.getDate());
lastMonthFirst =
new
Date(lastMonthFirst - oneday * (lastMonthFirst.getDate() - 1));
alert(lastMonthFirst);
阅读全文
0 0
- Js获取 时间 日期
- JS获取当前时间
- JS 获取服务器时间
- js获取当前时间
- js获取时间
- js 获取当前时间
- Js获取当前时间
- js 时刻获取时间
- js获取系统时间
- js获取时间
- js 获取当前时间
- js获取时间
- js获取时间
- js 获取系统时间
- js获取当前时间
- js获取时间
- js获取时间
- js获取服务器时间
- 包含min函数的栈 -- 漫漫算法路 刷题篇
- 香港主机如何设置网站404页面
- MySQL中tinytext、text、mediumtext和longtext详解
- 如何学好图像处理——从小白到大神?
- ExpandableListView使用中的问题与解决
- js获取时间
- 九度 题目1040:Prime Number
- Struts2 S2-052漏洞分析
- POJ 2387
- Linux的常用基本命令
- HA模式下,扩展HDFS集群遇到的问题,namenode 启动不起来!emmmmmmmm~
- 初学者实践日志2
- 关于工作的一些宏观把握
- javascript 滑动验证 仿淘宝滑动验证