PHP 날짜 계산 관련 함수
날짜 관련해서 여러 참고 자료들이 많치만
제가 많이 쓰는 것들만 올려봅니다.
$time = time();
echo date("Y-m-d",strtotime("-1 day", $time))." 하루 전(어제)";
echo date("Y-m-d",strtotime("-1 day", $time))." 하루 전(어제)";
echo date("Y-m-d",strtotime("now", $time))." 현재";
echo date("Y-m-d",strtotime("+1 day", $time))." 하루 후(내일)";
echo date("Y-m-d",strtotime("+1 week", $time))." 일주일 후";
echo date("Y-m-d",strtotime("-1 month", $time))." 한달 전";
echo date("Y-m-d",strtotime("+1 month", $time))." 다음달";
echo date("Y-m-d",strtotime("+6 month", $time))." 6달후";
echo date("Y-m-d",strtotime("+12 month", $time))." 12달후";
echo date("Y-m-d",strtotime("next Thursday", $time))." 다음주 목요일";
echo date("Y-m-d",strtotime("last Monday", $time))." 지난 월요일";
echo date("Y-m-d",strtotime("10 September 2000", $time))." 2000년 9월 10일";
echo strtotime("+5 minutes"); " 현재 시간보다 5분 후";
게시판 목록
개발자팁
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 4976 | 기타 | 5년 전 | 2120 | ||
| 4975 | 웹서버 |
nooree
|
5년 전 | 2768 | |
| 4974 | node.js |
younhoso
|
5년 전 | 2135 | |
| 4973 | PHP |
|
5년 전 | 3639 | |
| 4972 | 기타 |
younhoso
|
6년 전 | 2262 | |
| 4971 | JavaScript | 6년 전 | 2488 | ||
| 4970 | 웹서버 | 6년 전 | 4123 | ||
| 4969 | JavaScript |
|
6년 전 | 2783 | |
| 4968 | JavaScript |
|
6년 전 | 1935 | |
| 4967 | JavaScript |
younhoso
|
6년 전 | 2044 | |
| 4966 | JavaScript |
|
6년 전 | 2116 | |
| 4965 | PHP |
|
6년 전 | 2104 | |
| 4964 | 기타 | 6년 전 | 2921 | ||
| 4963 | JavaScript | 6년 전 | 2090 | ||
| 4962 | JavaScript | 6년 전 | 2286 | ||
| 4961 | jQuery |
아이티몬스
|
6년 전 | 2094 | |
| 4960 | PHP | 6년 전 | 2739 | ||
| 4959 | 기타 | 6년 전 | 2566 | ||
| 4958 | PHP |
아이티몬스
|
6년 전 | 4577 | |
| 4957 | 기타 | 6년 전 | 2094 | ||
| 4956 | 정규표현식 |
하늘위의길
|
6년 전 | 2322 | |
| 4955 | 정규표현식 |
하늘위의길
|
6년 전 | 2676 | |
| 4954 | 웹서버 |
하늘위의길
|
6년 전 | 4138 | |
| 4953 | PHP | 6년 전 | 2525 | ||
| 4952 | PHP |
몰라무서워
|
6년 전 | 3213 | |
| 4951 | MySQL | 6년 전 | 4131 | ||
| 4950 | jQuery | 6년 전 | 3614 | ||
| 4949 | node.js | 6년 전 | 2682 | ||
| 4948 | node.js | 6년 전 | 2406 | ||
| 4947 | node.js | 6년 전 | 2647 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기