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
{
///
/// 秒转换
///
///
///
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;
}
}
}