当前位置:网站首页>Time processing logic for the last 7 days, the last 10 days, and the last 90 days
Time processing logic for the last 7 days, the last 10 days, and the last 90 days
2022-06-11 16:09:00 【imkaifan】
// Get and format time parameters
getTimeParams(t) {
let endDate = new Date();
let startDate = new Date(endDate.getTime() - (t * 24 * 60 * 60 * 1000));
let startYear = startDate.getFullYear();
let endYear = endDate.getFullYear();
let startMonth = (startDate.getMonth() + 1) < 10 ? `0${
startDate.getMonth() + 1}` : (startDate.getMonth() + 1);
let endMonth = (endDate.getMonth() + 1) < 10 ? `0${
endDate.getMonth() + 1}` : (endDate.getMonth() + 1);
let startDay = startDate.getDate() < 10 ? `0${
startDate.getDate()}` : startDate.getDate();
let endDay = endDate.getDate() < 10 ? `0${
endDate.getDate()}` : endDate.getDate();
this.timeQuery.beginTime = `${
startYear}-${
startMonth}-${
startDay}T00:00:00+08:00`;
this.timeQuery.endTime = `${
endYear}-${
endMonth}-${
endDay}T23:59:59+08:00`;
},
边栏推荐
- Docker uses redis image
- 大龄码农从北京到荷兰的躺平生活
- Using cloud DB to build app quick start - quick application
- Frontier technology exploration deepsql: in Library AI algorithm
- (湖南科技大学oj作业)问题 G: 串的模式匹配
- Golang map basic operations
- Toolbar details of user interface - autorunner automated test tool
- Analysis of breadcrumb usage scenarios on websites
- Data enhancement
- GO语言数组和切片的区别
猜你喜欢

After reading the book reading methods

Aaai2022 latest "time series data processing" report, 127 pages of PPT describing time series data processing and medical application progress

1267_FreeRTOS启动第一个任务接口prvPortStartFirstTask实现分析

How to predict SQL statement query time?

Maui introductory tutorial series (1. framework introduction)

Data enhancement

GO语言-数组Array

How AGC security rules simplify user authorization and authentication requests

无心剑英汉双语诗001. 《春游》

Go language slice
随机推荐
Learn automatic testing of postman interface from 0 to 1
无心剑英汉双语诗001. 《春游》
With a lamp inserted in the nostril, the IQ has risen and become popular in Silicon Valley. 30000 yuan is enough
YEF 2022昨日开幕,多网络平台全程免费直播,开启在线技术盛宴!
Database design recommendations
大龄码农从北京到荷兰的躺平生活
Data enhancement
laravel 8 使用passport 进行Auth验证及颁发token
收藏 | 可解释机器学习发展和常见方法!
From repeatedly rejected manuscripts to post-90s assistant professor, Wang Hao of Rutgers University: curiosity drives me to constantly explore
How to predict SQL statement query time?
[LeetCode每日一题] |686.重复叠加字符串匹配
(湖南科技大学oj作业)问题 G: 串的模式匹配
jdbc调试错误,求指导
Code farming essential SQL tuning (Part 2)
Go Language - value type and Reference Type
postgresql启动过程
WGet command use
Opengauss database flashback function verification
Database resource load management (Part 2)