0
데이터베이스에 저장된 날짜와 현재 날짜의 날짜 차이를 가져 오는 데 어려움이 있습니다.데이터베이스에 저장된 날짜와 현재 날짜의 차이 얻기
<?php
date_default_timezone_set('Asia/Taipei');
$date = $_POST['date_posted']; //Date from the database
$now = new DateTime(); //Current date
echo $date->diff($now)->format("%y year/s, %m month/s, %d day/s");
?>
나는이 일에 새로 온 사람은 그래서 매우 다른 코드에 혼란 오전 : 이것은 내 샘플 코드입니다. 미리 감사드립니다. 그것이 작동 hopw