Skip to content

Instantly share code, notes, and snippets.

@hiro-matsuno
Created August 24, 2014 06:48
Show Gist options
  • Save hiro-matsuno/98915e44bf58bd22643e to your computer and use it in GitHub Desktop.
Save hiro-matsuno/98915e44bf58bd22643e to your computer and use it in GitHub Desktop.
PHPで現在日付を取得し日付文字列に変更する
//現在日付の取得
$now_date = getdate();
//年月日を取得する
$now_year = $now_date['year'];
$now_month = $now_date['mon'];
$now_day = $now_date['mday'];
//日付を整形
$nowDate = $now_year . "年" . $now_month . "月" . $now_day . '日';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment