Example #1
0
        /// <summary>
        /// Execute value
        /// </summary>
        public InternalEvaluatorValue Execute(List <InternalEvaluatorValue> args, ValueFactory factory)
        {
            var dateTimeFactory = factory.DateTime();

            var dateStr = args[0].GetWord();

            if (!DateTime.TryParse(dateStr, CultureInfo.InvariantCulture, DateTimeStyles.None, out var res))
            {
                if (!DateTime.TryParse(dateStr, out res))
                {
                    dateTimeFactory.Empty();
                }
            }

            return(dateTimeFactory.Create(res));
        }
 /// <summary>
 /// Execute value
 /// </summary>
 public InternalEvaluatorValue Execute(List <InternalEvaluatorValue> args, ValueFactory factory)
 {
     return(factory.DateTime().Create(DateTime.Now));
 }