生产管理
This commit is contained in:
38
Infrastructure/Converter/DOANConvertDateTime.cs
Normal file
38
Infrastructure/Converter/DOANConvertDateTime.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Infrastructure.Converter;
|
||||
|
||||
public class DOANConvertDate
|
||||
{
|
||||
/// <summary>
|
||||
/// 日期转本地日期
|
||||
/// </summary>
|
||||
/// <param name="handleDate"></param>
|
||||
/// <returns></returns>
|
||||
public static DateTime ConvertLocalDate(DateTime handleDate)
|
||||
{
|
||||
if (handleDate.Kind == DateTimeKind.Utc)
|
||||
{
|
||||
handleDate = handleDate.ToLocalTime();
|
||||
|
||||
}
|
||||
|
||||
return handleDate.Date;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 日期转本地日期
|
||||
/// </summary>
|
||||
/// <param name="handleDate"></param>
|
||||
/// <returns></returns>
|
||||
public static DateTime ConvertLocalDateTime(DateTime handleDate)
|
||||
{
|
||||
if (handleDate.Kind == DateTimeKind.Utc)
|
||||
{
|
||||
handleDate = handleDate.ToLocalTime();
|
||||
|
||||
}
|
||||
|
||||
return handleDate;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user