테스트 사이트 - 개발 중인 베타 버전입니다

날짜 출력 함수 질문 해봅니다.

· 15년 전 · 2650 · 3
1. 오늘 날짜 출력 함수
<?date("Y-m-d")?>
이런 것 일줄 알았는데 안되네요;;

2.주간은 strtotime("-1 week")) 이런것인가요?

그렇다면 월간은 strtotime("-1 month"))

이런식일 것 같은데 에러가 뜨네요

오늘 일주일전 한달전 날짜를 출력 하려면 어떻게 해야 하나요

형식은 ex

오늘 : 2010-08-17 일주일전 : 2010-08-10 이런식으로 출력 하고 싶습니다.

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 3개

<?

$time = time();

echo date("Y-m-d",strtotime("now"))."<br>"; // 오늘날짜

echo date("Y-m-d",strtotime("+1 day", $time))."하루후<br>";

echo date("Y-m-d",strtotime("+1 week", $time))."일주일후<br>";

echo date("Y-m-d",strtotime("+1 month", $time))."한달후<br>";

?>
echo date("Y-m-d"); // 오늘
echo "<br>";
echo date("Y-m-d", strtotime("-1 week")); // 일주전
echo "<br>";
echo date("Y-m-d", strtotime("-1 month")); // 한달전
냠냠이,OH플님
두분다 답변 정말 감사합니다 ^^
<?echo 가 있어야 하는군요 ^^ ?>

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440