DateTime.Today
new DateTime
AddYears
指定した日付の DateTime を生成します。
new DateTime(year, month, day)
下記の値を入力するとサンプルに即時反映されます。
dt
new
Console
WriteLine
ToString
DateTime dt = new DateTime(2024, 6, 15); Console.WriteLine(dt.ToString("yyyy-MM-dd")); // "2024-06-15"