2014-02-26 2 views

답변

4

, 당신은 방법 하위 및 DateInterval 객체를 사용할 수 있습니다

$date = new DateTime(null, new DateTimeZone('Asia/Kolkata')); 

echo $date->format('H:i:s').PHP_EOL; 
$date->sub(new DateInterval('PT5M')); 
echo $date->format('H:i:s').PHP_EOL; 

결과 :

17:44:04 
17:39:04 
6

는 참조 this

PHP 기능 :

strtotime()

예 : 목적 스타일에서

echo date('Y-m-d H:i:s', strtotime('-5 minutes')); 
1

테스트하지,하지만이 도움이 될 수 있습니다 .. $date->sub(new DateInterval('PT0H5M'));

링크 ::

http://www.php.net/manual/en/datetime.sub.php 
1

$ 날짜 = 한 strtotime ("- 오분 ")

2

시험해보세요. 이게 도움이되기를 바랍니다.

$ date = new DateTime (null, new DateTimeZone ('Asia/Kolkata')));

$ sysdate = date_format (strtotime ($ date), 'H : i : s');

에코 날짜 ('H : i : s', 시간 ($ sysdate) - 05 * 60);

관련 문제