当前位置:网站首页>Formatting of time objects
Formatting of time objects
2022-08-08 23:36:00 【Chung seed】
value timestamp
format format 'mm' to hour 'ss' to second, if not filled in, the default returns to day
connector If not filled in, the default is '-'
{string}
timeFormat: function (value, format, connector) {var date = new Date(value);var yy = date.getFullYear();var MM = date.getMonth() + 1;var dd = date.getDate();var hh = date.getHours();var mm = date.getMinutes();var ss = date.getSeconds();var link = '-';connector ? link = connector : link = '-';if (MM < 10)MM = "0" + MM;if (dd < 10)dd = "0" + dd;if (hh < 10)hh = "0" + hh;if (mm < 10)mm = "0" + mm;if (ss < 10)ss = "0" + ss;if (format === 'mm') {return "" + yy + link + MM + link + dd + " " + hh + ":" + mm;} else if (format === 'ss') {return "" + yy + link + MM + link + dd + " " + hh + ":" + mm + ":" + ss;} else {return "" + yy + link + MM + link + dd;}},
边栏推荐
- Modal dialog is used to implement the sign-in
- (2022牛客多校三)A-Ancestor(LCA)
- 最小生成树prim 求得 树上两点之间的最大最小值
- WeChat applet error undefined Expecting 'STRING','NUMBER','NULL','TRUE','FALSE','{','[', got ]Solution
- LightningChart .NET 10.3.2 Crack 支持旧项目直接升级
- Qt入门(四)——连续播放图片(两种定时器的运用)
- Kubernetes web网站无法访问
- 51nod 2882最短路 (树链剖分)
- 【瑞吉外卖】day04:员工分页查询、启用/禁用员工账号、编辑员工信息
- 线性筛求积性函数
猜你喜欢
随机推荐
获取本周的开始时间
树莓派wiringPi库的使用补充
获取当前时间的前/后某一天的日期
2022杭电多校六 1006-Maex (树形DP)
MySQL 高级知识【 MyISAM 读锁写锁限制】
06 Spark on RDD序列化问题
Learning experience of bp neural network
Introduction to Qt (4) - Continuous playback of pictures (the use of two timers)
08 Spark on RDD 依赖关系
stm32使用spi1在slave 模式下 dma 读取数据
WeChat applet develops some function usage methods
关于notepad++的js,xml插件安装
【深度学习】TensorFlow学习之路五:DNN防止过拟合的几种方法及TensorFlow实现
PMP考点有哪些啊?
stm32 uses serial port to receive idle interrupt + dma to achieve variable length dma reception
[PP-YOLOv2] Test a custom dataset
【LaTex异常与错误】 - 公式编号的参考引用命令\eqref发生错误Undefined control sequence——可能是因为没加载宏包amsmath
04 Spark on 读取外部数据分区策略(源码角度分析)
2022牛客多校六 M-Z-Game on grid(动态规划)
WeChat applet wx:for loop output example