php用datetime()格式化string的时间

Published
2022-04-22
浏览次数 :  28

$datetime =  get_post_meta( get_the_ID(), 'event_date_field',true );
                    $time = new DateTime($datetime);

                    var_dump($time->format('g:i'));

  • 标签1
  • 标签1
  • 标签1
Top