js获取当前时间:yyyy-MM-dd HH:MM:SS
2024-08-23 11:54:41
var nowDate = new Date();var year = nowDate.getFullYear(); var month = nowDate.getMonth() + < ? "" + (nowDate.getMonth() + ): nowDate.getMonth() + ; var day = nowDate.getDate() < ? "" + nowDate.getDate() : nowDate.getDate(); var hours = nowDate.getHours()<?"" + nowDate.getHours():nowDate.getHours();
var minutes = nowDate.getMinutes()<?"" + nowDate.getMinutes():nowDate.getMinutes();
var seconds = nowDate.getSeconds()<?"" + nowDate.getSeconds():nowDate.getSeconds(); var dateStr = year + "-" + month + "-" + day+ " " + hours+ ":" + minutes+ ":" + seconds;
console.log(dateStr);
这是结果
我要转html5和js,哎,其实还挺喜欢写后端的,但是希望自己转变一下,加油吧
最新文章
- mybatis输出SQL
- 一个类似backbone路由的纯净route ( 前端路由 客户端路由 backbone路由 )
- 树莓派USB摄像头与camera模块对比
- 纯CSS仿windows系统loading效果
- (medium)LeetCode 222.Count Complete Tree Nodes
- word编号库中找不到带圈编号“①②③......";了怎么办?
- http学习笔记一
- lightoj 1236 正整数唯一分解定理
- js分页代码
- 创建Activity
- Codeforces Round #246 (Div. 2) —B. Football Kit
- 每日算法37:Rotate Image (图像旋转)
- 8.2 sikuli 集成进eclipse 报错:Getting the VisionProxy.dll: Can not find dependent libraries...
- [算法] kmp实现
- Java加密解密字符串
- 配置SSH三大框架报错
- 20175316盛茂淞 2018-2019-2《Java程序设计》结对编程项目-四则运算 第二周(6)
- ajax请求头加Token时发生的跨域(CORS)请求问题
- Django-website 程序案例系列-4 ORM数据库操作
- PCIe 复位:Clod reset、warm reset、Hot reset、Function level reset
热门文章
- JavaScript-跨浏览器事件处理程序(EventUtil)
- 《京东B2B业务架构演变》阅读
- 每天进步一点点------Modelsim添加Xilinx仿真库的详细步骤
- upload-labs打关详解
- java面试记录二:spring加载流程、springmvc请求流程、spring事务失效、synchronized和volatile、JMM和JVM模型、二分查找的实现、垃圾收集器、控制台顺序打印ABC的三种线程实现
- 2020牛客寒假算法基础集训营1 I-nico和niconiconi
- Mapped Statements collection does not contain value for xxx
- 【手抖康复训练1 】Codeforces Global Round 6
- Pytest学习9-常用插件
- Angular 相关概念