最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

javascript實(shí)現(xiàn)的距離現(xiàn)在多長時(shí)間后的一個(gè)格式化的日期

 更新時(shí)間:2009年10月29日 22:32:50   作者:  
距離現(xiàn)在多長時(shí)間后的一個(gè)格式化的日期,大家可以看看。
復(fù)制代碼 代碼如下:

/**
*
* 返回一個(gè)距離現(xiàn)在多長時(shí)間后的一個(gè)格式化的日期,如2009年9月5日 14:15:23
* 如:現(xiàn)在時(shí)間是2009年9月5日 14:15:23 timeLong=10秒 那么返回:2009年9月5日 14:15:33
*
* @param int timeLong 一個(gè)
* @param String formatString YYYY-MM-DD hh:mm:ss
*
*/
function getOneFormatDate(timeLong,formatString)
{
timeLong=parseInt(timeLong);
timeLong=timeLong*1000;
var myDate=new Date();
var futureDate=new Date(parseInt(myDate.getTime())+timeLong);
var year=futureDate.getYear();
var month=futureDate.getMonth();
var day=futureDate.getDate();
var hour=futureDate.getHours();
var minute=futureDate.getMinutes();
var second=futureDate.getSeconds();

if(hour<10)
{
hour="0"+hour;
}
if(minute<10)
{
minute="0"+minute;
}
if(second<10)
{
second="0"+second;
}
formatString=formatString.replace("YYYY",year);
formatString=formatString.replace("MM",month);
formatString=formatString.replace("DD",day);
formatString=formatString.replace("hh",hour);
formatString=formatString.replace("mm",minute);
formatString=formatString.replace("ss",second);
return formatString;
}

相關(guān)文章

最新評論

阿拉善盟| 赣州市| 抚州市| 呈贡县| 齐河县| 滨海县| 会泽县| 岳西县| 长乐市| 伽师县| 商城县| 仪征市| 普兰县| 望江县| 津市市| 泰和县| 平远县| 杂多县| 苏州市| 东莞市| 恭城| 昭平县| 甘南县| 祁阳县| 柳林县| 宿迁市| 大余县| 嘉鱼县| 都匀市| 镇巴县| 桓仁| 积石山| 故城县| 潞城市| 清苑县| 古田县| 武平县| 台北市| 晴隆县| 澄迈县| 河南省|