Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.dynjs.runtime.builtins.types.date.prototype;
 
 
public class SetUTCMilliseconds extends AbstractDateFunction {
    public SetUTCMilliseconds(GlobalObject globalObject) {
        super(globalObject"ms");
    }
    @Override
    public Object call(ExecutionContext contextObject selfObject... args) {
        if ( ! ( self instanceof DynDate ) ) {
            throw new ThrowExceptioncontextcontext.createTypeError"setUTCMilliseconds(...) may only be used with Dates" ) );
        }
        
        DynDate dateObj = (DynDateself;
        
        long t = dateObj.getTimeValue();
        
        Number time = makeTime(contexthourFromTime(t), minFromTime(t), secFromTime(t), Types.toNumber(contextargs[0]));
        Number u = timeClip(contextmakeDatecontextday(t), time ) );
        
        dateObj.setTimeValue(u);
        
        return u;
    }
New to GrepCode? Check out our FAQ X