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

Published
April 22, 2022
浏览次数 :  0

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

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

Top