当前位置:网站首页>[encapsulation of time format tool functions]
[encapsulation of time format tool functions]
2022-07-07 11:19:00 【Guodong pudding】
timegs.js
export default function formatMsgTime (timespan) {
var dateTime = new Date(timespan) // Convert the incoming string or MS to standard time
var year = dateTime.getFullYear()
var month = dateTime.getMonth() + 1
var day = dateTime.getDate()
var hour = dateTime.getHours()
var minute = dateTime.getMinutes()
// var second = dateTime.getSeconds()
var millisecond = dateTime.getTime() // Converts the time of the current edit to milliseconds
var now = new Date() // Get the current time of the machine
var nowNew = now.getTime() // Convert local time to milliseconds
var milliseconds = 0
var timeSpanStr
milliseconds = nowNew - millisecond
if (milliseconds <= 1000 * 60 * 1) { // Less than a minute for just
timeSpanStr = ' just '
} else if (1000 * 60 * 1 < milliseconds && milliseconds <= 1000 * 60 * 60) { // More than one minute and less than one hour are displayed as 边栏推荐
- uniapp 在onLaunch中跳转页面后,点击事件失效解决方法
- The seventh training assignment
- 自动化测试框架
- Verilog realizes nixie tube display driver [with source code]
- 【pyqt】tableWidget里的cellWidget使用信号与槽机制
- Graduation season | keep company with youth and look forward to the future together!
- [untitled]
- 技术分享 | 抓包分析 TCP 协议
- Case study of Jinshan API translation function based on retrofit framework
- 基于STC8G1K08的0.96寸IIC液晶屏驱动程序
猜你喜欢

Learning notes | data Xiaobai uses dataease to make a large data screen

對比學習之 Unsupervised Learning of Visual Features by Contrasting Cluster Assignments
![[untitled]](/img/f9/18b85ad17d4c560f2b9d95a53ee72a.jpg)
[untitled]

如何在博客中添加Aplayer音乐播放器

LeetCode - 面试题17.24 最大子矩阵

关于jmeter中编写shell脚本json的应用

Antd select selector drop-down box follows the scroll bar to scroll through the solution

uniCloud

Interprocess communication (IPC)

How to remove addition and subtraction from inputnumber input box
随机推荐
About the application of writing shell script JSON in JMeter
Mysql的json格式查询
Rolling puddle Uni_ App (VIII)
RationalDMIS2022 高级编程宏程序
How to remove addition and subtraction from inputnumber input box
Qtcreator sets multiple qmake
[untitled]
electron添加SQLite数据库
Bookmarking - common website navigation for programmers
Shardingsphere sub database and table examples (logical table, real table, binding table, broadcast table, single table)
Process control (creation, termination, waiting, program replacement)
使用MeterSphere让你的测试工作持续高效
Debezium同步之Debezium架构详解
JSON format query of MySQL
[untitled]
Seata 1.3.0 four modes to solve distributed transactions (at, TCC, Saga, XA)
There are ways to improve self-discipline and self-control
Which securities company is the best and safest to open an account for the subscription of new shares
数据库同步工具 DBSync 新增对MongoDB、ES的支持
Vuthink正确安装过程