using System.Collections.Generic; | |
using System.Globalization; | |
namespace AppsheetEpplus; | |
public abstract class DateParsingFunction : ExcelFunction { | |
protected System.DateTime ParseDate(IEnumerable<FunctionArgument> arguments, object dateObj) { | |
System.DateTime date; | |
if (dateObj is string) { | |
date = System.DateTime.Parse(dateObj.ToString(), CultureInfo.InvariantCulture); | |
} else { | |
var d = ArgToDecimal(arguments, 0); | |
date = System.DateTime.FromOADate(d); | |
} | |
return date; | |
} | |
} |