함수 week2range()

Jmnote bot (토론 | 기여)님의 2020년 11월 2일 (월) 02:36 판 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
week2range
  • test set
2007-W01 → (2007-01-01, 2007-01-07)
2009-W01 → (2008-12-29, 2009-01-04)

1 PHP[ | ]

function week2range($week) {
	return array( date('Y-m-d', strtotime("$week-1")),
		date('Y-m-d', strtotime("$week-7")));
}
print_r( week2range('2009-W01') );
// Array
// (
//     [0] => 2008-12-29
//     [1] => 2009-01-04
// )

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}