dqv2743 2017-04-27 08:40
浏览 25
已采纳

html5日期字段输入正确但输出反转

if have the following problem. in my html5 datefield, i have the input order dd.mm.yyyy (for example todays date: 27.04.2017).

<input type="date" />

thats correct in my country and timezone. the posted value is in reversed order to my input. its yyyy-mm-dd (for example todays date: 2017-04-27).

is there any way to change the timeformat if the the value is posted?

ive found several solutions but only for the input and not the posted values.

</div>
  • 写回答

2条回答 默认 最新

  • dtz88967 2017-04-27 08:52
    关注

    I'm not really sure what you mean but here is something you can try

       $time = strtotime($_POST['dateInput']);
        if ($time != false) {
          $mydate = date('d-m-Y', $time));
        }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统