using Furion.TaskScheduler;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace iWare.Wms.Application
|
{
|
public class CommonHelper
|
{
|
/// <summary>
|
/// 秒转换
|
/// </summary>
|
/// <param name="seconds"></param>
|
/// <returns></returns>
|
public static string GetTimeString(DateTimeOffset? start,DateTimeOffset? end)
|
{
|
if (start == null || end == null)
|
{
|
return "0秒";
|
}
|
if (start > end)
|
{
|
return "0秒";
|
}
|
TimeSpan ts = ((DateTimeOffset)end - (DateTimeOffset)start);
|
string msg = "";
|
if (ts.Days != 0)
|
{
|
msg += ts.Days + "天";
|
}
|
if (ts.Hours != 0)
|
{
|
msg += ts.Hours + "小时";
|
}
|
if (ts.Minutes != 0)
|
{
|
msg += ts.Minutes + "分钟";
|
}
|
if (ts.Seconds != 0)
|
{
|
msg += ts.Seconds + "秒";
|
}
|
return msg;
|
}
|
}
|
}
|