Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Globalization;
|
---|
4 | using System.Linq;
|
---|
5 | using System.Text;
|
---|
6 |
|
---|
7 | namespace OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime
|
---|
8 | {
|
---|
9 | public abstract class DateParsingFunction : ExcelFunction
|
---|
10 | {
|
---|
11 | protected System.DateTime ParseDate(IEnumerable<FunctionArgument> arguments, object dateObj)
|
---|
12 | {
|
---|
13 | System.DateTime date = System.DateTime.MinValue;
|
---|
14 | if (dateObj is string)
|
---|
15 | {
|
---|
16 | date = System.DateTime.Parse(dateObj.ToString(), CultureInfo.InvariantCulture);
|
---|
17 | }
|
---|
18 | else
|
---|
19 | {
|
---|
20 | var d = ArgToDecimal(arguments, 0);
|
---|
21 | date = System.DateTime.FromOADate(d);
|
---|
22 | }
|
---|
23 | return date;
|
---|
24 | }
|
---|
25 | }
|
---|
26 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.