티스토리 뷰

정보 보관 ver1.0

date

James Wetzel 2011. 7. 29. 17:57
date 함수를 이용하여 날짜를 더하거나 빼기 혹은 주를 더하거나 빼기.

string
 date ( string $format [, int $timestamp = time() ] )

$end date("Y-m-d",strtotime("-1 day"));

int strtotime ( string $time [, int $now ] ) 
<?php
echo strtotime("now"), "\n";
echo 
strtotime("10 September 2000"), "\n";
echo 
strtotime("+1 day"), "\n";
echo 
strtotime("+1 week"), "\n";
echo 
strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";
echo 
strtotime("next Thursday"), "\n";
echo 
strtotime("last Monday"), "\n";
?>
 
728x90
반응형