当前位置:网站首页>Formatting of time objects
Formatting of time objects
2022-08-08 23:36:00 【Satoshi seeds】
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;}},
边栏推荐
- 最详树莓派4B装机流程及ifconfig不到wlan0的解决办法
- 51nod 2887 抓小偷 平面图最小割转换成最短路
- 如何在Android中使用Realm数据库
- Manacher(求解最长回文子串)
- 2022杭电多校六 1006-Maex (树形DP)
- 06 Spark on RDD序列化问题
- grpc系列3-自定义端镜像GOAWAY with error code ENHANCE_YOUR_CALM and debug data equal to “too_many_pings“
- 获取当前一周时间 不含当天
- Share | design based on MCU P0 mouth to drive the LED flashing
- 树莓派wiringPi库的使用补充
猜你喜欢
ViewOverlay与ViewGroupOverlay
神经网络学习笔记(1)
深入理解计算系统第三章程序的机器级表达总结
WeChat applet wx:for loop output example
09 Spark on RDD 阶段划分
Modal dialog is used to implement the sign-in
(Codeforce 757)E. Bash Plays with Functions(积性函数)
【深度学习】TensorFlow学习之路三:梯度消失\爆炸及解决办法
(2022牛客多校五)C-Bit Transmission(思维)
WeChat applet error undefined Expecting 'STRING','NUMBER','NULL','TRUE','FALSE','{','[', got ]Solution
随机推荐
ViewOverlay与ViewGroupOverlay
PHP闭包函数 bingTo的使用
(Codeforce 757)E. Bash Plays with Functions(积性函数)
Excel 2013 下拉为“快速分拆”调整为“填充序号”
记录一些 PostgreSQL问题分析思路
2022杭电多校六 1006-Maex (树形DP)
Hi3516 使用 wifi模块
(2022牛客多校五)D-Birds in the tree(树形DP)
Share | design based on MCU P0 mouth to drive the LED flashing
一命令删除所有指定进程
北斗网络同步时钟与GPS卫星时钟同步设备的区别
Qt入门(五)——文件操作、热键和鼠标的读取(txt窗口的实现)
域前置通信过程和溯源思路
mysql 高级知识【order by 排序优化】
MySQL indexes a field in a table
2022牛客多校六 A-Array(构造+哈夫曼)
最常用正则表达式
(2022杭电多校六)1010-Planar graph(最小生成树)
11 Spark on RDD CheckPoint
-Wl,--start-group ... -Wl,--end-group 用于解决几个库的循环依赖关系