Last active
December 15, 2016 09:07
-
-
Save Mo3g4u/38b1ca19e76c8e33bb93f551eff7967a to your computer and use it in GitHub Desktop.
特定のフォーマットから日付を取り込んで、前の月の末日を取得
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: takeuchi | |
* Date: 2016/12/15 | |
* Time: 17:58 | |
*/ | |
$date = DateTime::createFromFormat('Y年m月d日', '2017年06月11日'); | |
$date->modify('-1 months'); | |
echo $date->format('Y年m月t日'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment