Jint.Native.JsDateConstructor.SetMillisecondsImpl C# (CSharp) Метод

SetMillisecondsImpl() публичный Метод

15.9.5.28
public SetMillisecondsImpl ( JsDictionaryObject target, JsInstance parameters ) : JsInstance
target JsDictionaryObject
parameters JsInstance
Результат JsInstance
        public JsInstance SetMillisecondsImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (parameters.Length == 0)
                throw new ArgumentException("There was no millisecond specified");

            DateTime valueOf = CreateDateTime(target.ToNumber()).ToLocalTime();
            valueOf = valueOf.AddMilliseconds(-valueOf.Millisecond);
            valueOf = valueOf.AddMilliseconds(parameters[0].ToNumber());
            target.Value = New(valueOf).ToNumber();
            return target;
        }