2017-04-19から1日間の記事一覧

各言語での「翌月1日」の求め方

C# で「翌月1日」の DateTime を作るのに、こんなコードを書いてしまいました。 DateTime today = DateTime.Today; DateTime nextMonth = new DateTime(today.Year, today.Month + 1, 1); 結果、12月1日になったら new DateTime(2017, 13, 1) となってしまい…