Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
06.06.2013 (この 2013-06-06 のような形式) など、php で指定された日付に応じて暦週を計算する方法を誰かが知っている場合。私は午前中ずっと解決策を探していましたが、何も役に立ちませんでした。ヘルプやリンクなど、何でもいただければ幸いです。ありがとうございました
使用するdate("W")
date("W")
echo date("W", strtotime('2013-06-06'));
実際に見る
date('W')年の週を与える必要があります。RTM
date('W')
Unix タイムスタンプとして時間がない場合は、strtotime()最初に使用して 2 番目のパラメーターとして渡すことができます
strtotime()
元。date('W',strtotime($my_time_string))
date('W',strtotime($my_time_string))
PHPのマニュアルはこちら
このような:
$time = '2013-06-06'; $calendar_week = date('W', strtotime($time));