当前位置:网站首页>Format time
Format time
2022-07-21 20:35:00 【Plum vegetable】
// Format time
function dateFtt(fmt,date){ //author: meizz
var o = {
"M+" : date.getMonth()+1, // month
"d+" : date.getDate(), // Japan
"h+" : date.getHours(), // Hours
"m+" : date.getMinutes(), // branch
"s+" : date.getSeconds(), // second
"q+" : Math.floor((date.getMonth()+3)/3), // quarter
"S" : date.getMilliseconds() // millisecond
};
if(/(y+)/.test(fmt))
fmt=fmt.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
for(var k in o)
if(new RegExp("("+ k +")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
return fmt;
}
// call
var createDate=dateFtt("MM month dd Japan hh:mm",new Date(item["createDate"]));
Use
+'<span class="me_center_top_xinxi_time">'+createDate+'</span>'
边栏推荐
- 22.【【静态成员访问格式】类名::访问成员,则该成员需要是静态】
- [c language] light rises in the dull days, the initial stage and the final battle
- Available parameters are [list]批量上传时错误
- Detailed explanation of scanf - scanf usage you don't know
- leetcode中面试题17.04.消失的数字 和 27.移除元素
- 在ROS上跑高飞组代码遇到[global_planning_node-5] process has died [pid 3143, exit code -6, cmd /home/gaofei/ROS
- 20.【char*与string相等不相等】
- 今天不拉扯了 不拉扯了 碎碎念 上
- 图片上传
- Luogu p1119 post disaster reconstruction (Floyd)
猜你喜欢
随机推荐
C. Doremy‘s IQ
General paging 01
重置表单
P1364 hospital settings
1009 irony
再见了,各位(虽然没人会注意到)
第四局 下 匹配数据分析
[C语言] 平淡的日子里泛起光 初阶最后的战役
PCL学习第九章《采样一致性》
Csdn2022 top ten statistics
codeforces 1647A Madoka and Math Dad
LaTeX:导数相关符号
[C language] run away and get out of this secular C preliminary and final battle full of fireworks
The fifth Bureau, akali teaching Bureau
无法从“boost::shared_ptr<pcl::RangeImage>”转换为“const std::shared_ptr<const pcl::PointCloud<pcl::PointWit
第五局 阿卡丽教学局 下 数据分析
In depth analysis - Data
Let the code solve the "linear algebra" series - polynomial summation
MySQL之CRUD
如何使用迭代最近点ICP