---
# System prepended metadata

title: C# DateTime.AddMonths の仕様 2023-10-18
tags: [C#, DateTime, AddMonths]

---

---
lang: ja-jp
breaks: true
---
# C# DateTime.AddMonths の仕様 2023-10-18

## １月末日に１か月足すと、２月末日になる。

```csharp=
Console.WriteLine((new DateTime(2023, 1, 31)));
Console.WriteLine((new DateTime(2023, 1, 31).AddMonths(1)));
```

![](https://hackmd.io/_uploads/r159QRh-6.png)



###### tags: `C#` `DateTime` `AddMonths`
