zoukankan      html  css  js  c++  java
  • 【JavaScript】时间戳转日期格式

    时间戳: 1480570979000

        $.ajax({
                
                    url : "getOrderMsg?shiplabel="+ shiplabel,
                    type : "get",    
                    success : function(data) {//ajax返回的数据    
                        var now = new Date(data.createtime); //data.createtime=1480570979000
    var years=now.getYear(); 
    var year
    = (years+"").substring(1);
    var month
    =now.getMonth()+1;
    var date
    =now.getDate();
    var hour
    =now.getHours();
    var minute
    =now.getMinutes();
    var second
    =now.getSeconds();
    var date
    = "20"+year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
    var html
    ="订单号:"+data.ordernumber+" 订单创建时间:"+date+" 收件人:"+data.shiptoname+" 电话:"+data.shiptophone+" 地址:"+data.addr;
    $(
    "#p1").html(html).show(); } });

  • 相关阅读:
    裴蜀定理
    欧几里得算法
    最大公约数
    质数和合数
    整除
    CSP斗地主
    skkyk:点分治
    题解:P2130 狂奔的Wzf
    题解:最大子树和
    博客大换主题祭
  • 原文地址:https://www.cnblogs.com/dflmg/p/7084499.html
Copyright © 2011-2022 走看看