[ PHP, Javascript ]特定の日付の曜日を返
ページ情報
YE 20-09-11 13:05 照会 23回本文
[ PHP, Javascript ]特定の日付の曜日を返
Javascript
[code] var week = ['日','月','火','水','木','金','土']; var dayOfWeek = week[new Date('2016-07-28').getDay()]; return dayOfWeek; new Date('2016-07-28').getDay(); // 曜日ごとのインデックス番号を返 [/code]
PHP
[code] $week = array("日","月","火","水","木","金","土"); echo ($week [date('w', strtotime($day))]); date('w', strtotime($day)); // 曜日ごとのインデックス番号を返 [/code]