으로는 문제가 strtotime()
의 사용이다 주목해야 할 것으로 기대하고있다. 내 컴퓨터에서 다음과 같이 작동합니다.
$date_text = $row['startTime']; // assuming the format "00:12:30"
list($hrs,$mins,$secs) = explode(":",$date_text); // in response to the question in the comments
/* the explode() takes the string "00:12:30" and breaks into three components "00","12" and "30".
these components are named, by their order in the array formed by explode(), as $hrs, $mins and $secs.
see: http://us3.php.net/manual/en/function.explode.php
and: http://us3.php.net/manual/en/function.list.php
*/
echo "<p>" . date("g:i",mktime($hrs,$mins,$secs)) . "</p>";
열의 데이터 형식은 무엇입니까? $ row [ 'startTime']을 echo하면 무엇을 얻을 수 있습니까? – Artelius
이 멈춘다. 만약 날짜가 '00 : 12 : 30'으로 저장되어 있고 시간 (g)과 분 (i)을 표시하고 싶다면 단순히'echo substr ($ dateText, 0,5)'어디'$ dateText = $ row [ 'startTime'];'? –
시간 데이터 유형입니다. 나는 단순히 $ row [ 'startTime']을 echo했을 때 아무 것도 나타나지 않는다. 그것의 기괴함은 – zeckdude