LoginSignup
0

More than 5 years have passed since last update.

日付に関するクラスについてのメモ(ドットインストールのカレンダー作成より)

Posted at

日付に関するクラスがわからない

ドットインストールでPHPでカレンダーを作成する講座を受講していたら見知らぬクラスが出てきたので、調査を行った

DatePeriodクラス

引数
・開始日(指定した日付を含む)
・形式
・終了日(指定した日付を含まない)

DateIntervalクラス

形式を指定

http://php.net/manual/ja/dateinterval.construct.php
を参照

DateTimeクラス

日付と時刻をあらわす
様々な書式に対応しているようです
http://php.net/manual/ja/datetime.formats.php
を参照

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0