当前位置:网站首页>JS get all date or time stamps between two time stamps
JS get all date or time stamps between two time stamps
2022-07-07 07:35:00 【GMLGDJ】
let start = new Date(1642694400000) // 2022-01-21 00:00:00
let end = new Date(1643644800000) // 2022-02-01 00:00:00
dateList = getAllDateCN(date1, date2)
console.log(dateList);
function getAllDateCN(startTime, endTime) {
let date_all = [];
let i = 0;
while (endTime.getTime() - startTime.getTime() >= 0) {
// Get date and time
let year = startTime.getFullYear()
let month = startTime.getMonth() + 1
let day = startTime.getDate()
let time = startTime.toLocaleTimeString()
date_all[i] = year + ' year ' + month + ' month ' + day + ' Japan ' + time
// Get daily 00:00:00 The timestamp
// date_all[i] = new Date(startTime.toLocaleDateString()).getTime() / 1000;
// Days +1
startTime.setDate(startTime.getDate() + 1);
i += 1;
}
return date_all;
}边栏推荐
- 虚拟机的作用
- How to reduce inventory with high concurrency on the Internet
- After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
- nacos
- Bindingexception exception (error reporting) processing
- Deep learning Flower Book + machine learning watermelon book electronic version I found
- URP - shaders and materials - light shader lit
- Write CPU yourself -- Chapter 9 -- learning notes
- 电商常规问题part1
- 1090: integer power (multi instance test)
猜你喜欢

I failed in the postgraduate entrance examination and couldn't get into the big factory. I feel like it's over

UWB learning 1

@component(““)

07_ Handout on the essence and practical skills of text measurement and geometric transformation

A concurrent rule verification implementation

$parent (get parent component) and $root (get root component)

面试官:你都了解哪些开发模型?

Le Service MySQL manque dans le service informatique

1140_ SiCp learning notes_ Use Newton's method to solve the square root

The currently released SKU (sales specification) information contains words that are suspected to have nothing to do with baby
随机推荐
Fast quantitative, abbkine protein quantitative kit BCA method is coming!
在线直播系统源码,使用ValueAnimator实现view放大缩小动画效果
Sqlmap tutorial (IV) practical skills three: bypass the firewall
JS small exercise
Invalid table alias or column reference`xxx`
Dynamics CRM server deployment - restore database prompt: the database is in use
一、Go知识查缺补漏+实战课程笔记 | 青训营笔记
C language (high-level) data storage + Practice
Hidden Markov model (HMM) learning notes
[ANSYS] learning experience of APDL finite element analysis
Leetcode sword finger offer brush questions - day 20
抽丝剥茧C语言(高阶)数据的储存+练习
English translation is too difficult? I wrote two translation scripts with crawler in a rage
Talk about seven ways to realize asynchronous programming
Initial experience of teambiion network disk (Alibaba cloud network disk)
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
Advanced practice of C language (high level) pointer
計算機服務中缺失MySQL服務
直播平台源码,可折叠式菜单栏
@component(““)