diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index c23a9cf9908..e09099ecafa 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -1670,8 +1670,13 @@ static HRESULT Global_Minute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VA static HRESULT Global_Second(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wSecond); } static HRESULT Global_DateValue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs index 640fe63caec..480e9d91100 100644 --- a/dlls/vbscript/tests/api.vbs +++ b/dlls/vbscript/tests/api.vbs @@ -1454,6 +1454,8 @@ Call ok(Hour(2.75) = 18, "Hour(2) = " & Hour(2.75)) Call ok(getVT(Minute(now)) = "VT_I2", "getVT(Minute(now)) = " & getVT(Minute(now))) Call ok(Minute(2) = 0, "Minute(2) = " & Minute(2)) Call ok(Minute(2.02083) = 30, "Minute(2.02083) = " & Minute(2.02083)) +Call ok(getVT(Second(now)) = "VT_I2", "getVT(Second(now)) = " & getVT(Second(now))) +Call ok(Second(2) = 0, "Second(2) = " & Second(2)) Sub testRGBError(arg1, arg2, arg3, error_num) on error resume next