doudou0111 2019-07-19 18:57 采纳率: 0%
浏览 90

在wordpress / php中的date_i18n

I am working on a html/php code as shown below:

HTML/PHP Code:

<time datetime="<?php echo esc_attr(date_format($ts, 'H:i d-m-Y')) ?>"
   data-timezone="<?php echo esc_attr($tz_param) ?>"><?php echo ucfirst(date_i18n( 'F j H:i', $ts->getTimeStamp())); ?>
</time>

The above html/php code displays the following on inspect:

<time datetime="02:15 19-07-2019" data-timezone="he">Juillet 19 06:15</time>

The time here Juillet 19 06:15 doesn't seems to match the time here 02:15 19-07-2019 which is inside the datetime attribute

On debugging print_r($ts), it prints:

 DateTime Object
(
    [date] => 2019-07-19 01:00:00.000000
    [timezone_type] => 3
    [timezone] => America/New_York
)

Problem Statement:

I am wondering what changes I should make in the php code so that the time here Juillet 19 06:15 should be equal to the time inside datetime attribute 02:15 19-07-2019

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
    • ¥30 python代码,帮调试
    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊