数据库时间读取的格式按照 系统的个好似形式 读出来的
不管系统格式是什么 统一转换成mm/dd/yyyy
怎么处理
不管系统格式是什么 统一转换成mm/dd/yyyy
怎么处理
解决方案 »
- 急急急!!!!!!!!1
- div 把现有的滑动条改成在底部横向的
- js脚本问题
- 紧急求助:showModalDialog的问题!!!在线等
- JS 日期验证
- 100分求js一个小问题
- 使用XMLHTTPRequest 读取XML文件可以使用schema进行验证么?
- 关于在HTML编辑器中使用<A、<img、<OBJECT等标签出现的会自动更改问题:<a href="a.html">会转换为<a href="http://www/a.html">……
- 不是打开,而是下载文件,如何实现
- 请教,怎样判断一个变量是否为undefined????
- 新手!!!关于写脚本script的工具
- 高手帮忙实现个JS功能。
function TimeFormat(d) {
var str = (d.getMonth() + 1) + "/"
str += d.getDate() + " /"
str += d.getFullYear();
return str;
} alert(TimeFormat(new Date()));
Date.prototype.format = function(format)
{
var o ={
'M+' : this.getMonth()+1, //month
'd+' : this.getDate(), //day
'h+' : this.getHours(), //hour
's+' : this.getSeconds(), //second
'm+' : this.getMinutes(), //minute
'q+' : Math.floor((this.getMonth()+3)/3), //quarter
'S' : this.getMilliseconds() //millisecond
};
if(/(y+)/.test(format)){format=format.replace(RegExp.$1,(this.getFullYear()+'').substr(4 - RegExp.$1.length));}
for(var k in o){
if(new RegExp('('+ k +')').test(format)){format = format.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ('00'+ o[k]).substr((''+ o[k]).length));}}
return format;
};alert(new Date().format('yyyy-MM-dd hh:mm:ss'));