39 lines
829 B
C#
39 lines
829 B
C#
using System;
|
|
|
|
namespace Infrastructure.Converter;
|
|
|
|
public class DOANConvertDateTime
|
|
{
|
|
/// <summary>
|
|
/// 日期转本地日期
|
|
/// </summary>
|
|
/// <param name="handleDate"></param>
|
|
/// <returns></returns>
|
|
public static DateTime ConvertLocalDateTime(DateTime handleDate)
|
|
{
|
|
if (handleDate.Kind == DateTimeKind.Utc)
|
|
{
|
|
handleDate = handleDate.ToLocalTime();
|
|
|
|
}
|
|
|
|
return handleDate.Date;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 日期转本地日期
|
|
/// </summary>
|
|
/// <param name="handleDate"></param>
|
|
/// <returns></returns>
|
|
public static DateTime ConvertLocalDate(DateTime handleDate)
|
|
{
|
|
if (handleDate.Kind == DateTimeKind.Utc)
|
|
{
|
|
handleDate = handleDate.ToLocalTime();
|
|
|
|
}
|
|
|
|
return handleDate;
|
|
}
|
|
}
|