// 时间
let date = new Date();
debugger;
let seperator1 = "-";
let seperator2 = ":";
let month = date.getMonth() + 1;
let strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
let mytime = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds();
相关文章
- 用moment插件分别取时间戳的年、月、日、时、分、秒
- 输入年份和天数,输出对应的年、月、日 (15分)
- VBA - 以当前系统时间(年、月、日、时、分、秒)命名文件夹
- WeUI移动页面实现时间选择器(年-月-日-时-分)
- 华为ensp中aaa(3a)实现telnet远程连接认证配置命令-创作时间:2024年4月14日18点49分
- Android构建项目时出现的小bug们(2018年5月19日19:31:20)
- C#把当前时间(年-月-日 时-分-秒)写入到数据库中并且显示具体时间
- SQL Server中如何获取当前年,月,日,时,分,秒
- ASP.NET 日期 时间 年 月 日 时 分 秒 格式及转换
- 【yoyo】计算2018年1月1日距当天事件还剩多少天,多少小时,多少分钟,多少秒;