【问题标题】:date format using Ajaxpro使用 Ajaxpro 的日期格式
【发布时间】:2009-05-01 02:54:18
【问题描述】:

我正在使用 AjaxPro 检索数据库,日期字段返回 Sat Apr 3 00:00:00 UTC+0700 1982 我想将其格式化为“dd/mm/yyyy”。 p>

【问题讨论】:

    标签: date format ajaxpro


    【解决方案1】:

    假设您从服务器获取 DateTime 值,您可以执行类似的操作:

    访问http://www.ajaxpro.info/Examples/DataType/default.aspx 并在 Firebug 中运行以下代码。

    var result = AJAXDemo.Examples.DataType.Demo.GetDateTime(new Date()).value;
    var year = result.getFullYear();
    var month = result.getMonth() + 1;
    var day = result.getDate();
    var formattedDate = [day, month, year].join('/');
    console.log(formattedDate);
    

    【讨论】:

    • 不客气,thienthai。如果您认为它回答了您的问题,请记住为我的答案投票和/或将其标记为已接受。干杯。
    猜你喜欢
    • 1970-01-01
    • 2020-09-30
    • 2012-06-19
    • 2022-01-11
    • 1970-01-01
    • 2014-03-19
    • 1970-01-01
    • 1970-01-01
    • 2014-06-26
    相关资源
    最近更新 更多