private static string ToDateTimeValue(string warehouseTime)
{
if (!string.IsNullOrWhiteSpace(warehouseTime))
{
Decimal tempValue;
if (Decimal.TryParse(warehouseTime, out tempValue))
{
int day = Convert.ToInt32(Math.Truncate(tempValue));
DateTime dt = new DateTime(1900, 1, 1).AddDays(day < 32 ? (day - 1) : (day - 2));
return dt.ToString("yyyy-MM-dd");
}
else
{
return warehouseTime;
}
}
return string.Empty;
}