Hi guillaume86,
You can add
and then:
Note that this only works on V8, as JScript doesn't follow the
Good luck!
You can add
valueOf
as an extension method:publicstaticclass DateTimeExtensions { publicstaticdouble valueOf(this DateTime value) { return value.Ticks; } }
engine.AddHostType(typeof(DateTime)); engine.AddHostType(typeof(DateTimeExtensions)); Console.WriteLine(engine.Evaluate("a = DateTime.Now; b = DateTime.Now; b >= a"));
valueOf
protocol for host objects.Good luck!