using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hotline.Share.Tools;
public static class DateTimeExtensions
{
    /// <summary>
    /// 获取两个时间之间的差
    /// </summary>
    /// <param name="beginDateTime">开始时间</param>
    /// <param name="endDateTime">结束时间</param>
    /// <returns>相距秒数</returns>
    public static int GetDifferenceSeconds(this DateTime beginDateTime, DateTime endDateTime)
    {
        return (int)(beginDateTime - endDateTime).TotalSeconds;
    }
}
