Ejemplo n.º 1
0
 public ExcelValue DATE(List <ExcelValue> args, ExpressionScope scope)
 {
     if (args.NotInteger(0, null, out int year))
     {
         return(ExcelValue.NA);
     }
     if (args.NotInteger(1, null, out int month))
     {
         return(ExcelValue.NA);
     }
     if (args.NotInteger(2, null, out int day))
     {
         return(ExcelValue.NA);
     }
     return(ExcelValue.CreateDateValue(year, month, day, scope.OutLanguage, ExpressionFormat.ShortDatePattern));
 }
Ejemplo n.º 2
0
 public ExcelValue TIME(List <ExcelValue> args, ExpressionScope scope)
 {
     if (args.NotInteger(0, null, out int hours))
     {
         return(ExcelValue.NA);
     }
     if (args.NotInteger(1, null, out int minutes))
     {
         return(ExcelValue.NA);
     }
     if (args.NotInteger(2, null, out int seconds))
     {
         return(ExcelValue.NA);
     }
     return(ExcelValue.CreateDateValue(0, 0, 0, hours, minutes, seconds, scope.OutLanguage, ExpressionFormat.ShortTimePattern));
 }
Ejemplo n.º 3
0
        public ExcelValue NOW(List <ExcelValue> args, ExpressionScope scope)
        {
            var now = DateTime.Now;

            return(ExcelValue.CreateDateValue(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, scope.OutLanguage, ExpressionFormat.ShortDatePattern));
        }
Ejemplo n.º 4
0
        public ExcelValue TODAY(List <ExcelValue> args, ExpressionScope scope)
        {
            var today = DateTime.Today;

            return(ExcelValue.CreateDateValue(today.Year, today.Month, today.Day, 0, 0, 0, scope.OutLanguage, ExpressionFormat.ShortDatePattern));
        }