for Push.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KssSmaPlaLib.Commons
|
||||
{
|
||||
public static class DateHelperUxer
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 指定した年と月の末日を返します。
|
||||
/// </summary>
|
||||
/// <param name="year">年(例: 2025)</param>
|
||||
/// <param name="month">月(1~12)</param>
|
||||
/// <returns>末日(28~31)</returns>
|
||||
public static bool TryGetLastDayOfMonth(int year, int month, out int matsubi,out string resultMessage)
|
||||
{
|
||||
matsubi = -1;
|
||||
resultMessage = string.Empty;
|
||||
|
||||
if (month < 1 || month > 12)
|
||||
{
|
||||
resultMessage = "月が1~12の範囲ではありません。";
|
||||
return false;
|
||||
}
|
||||
|
||||
// DateTime構造体を使って末日を取得
|
||||
matsubi = DateTime.DaysInMonth(year, month);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user