vbscript: Implemented Date.

This commit is contained in:
Shuai Meng 2014-08-26 00:07:51 +08:00 committed by Alexandre Julliard
parent ad012a8a57
commit 88d7f611a4
2 changed files with 16 additions and 2 deletions

View File

@ -1400,8 +1400,20 @@ static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
FIXME("\n");
return E_NOTIMPL;
SYSTEMTIME lt;
UDATE ud;
DATE date;
HRESULT hres;
TRACE("\n");
GetLocalTime(&lt);
ud.st = lt;
ud.wDayOfYear = 0;
hres = VarDateFromUdateEx(&ud, 0, VAR_DATEVALUEONLY, &date);
if(FAILED(hres))
return hres;
return return_date(res, date);
}
static HRESULT Global_Time(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)

View File

@ -1237,4 +1237,6 @@ Call ok(getVT(Log("10")) = "VT_R8", "getVT(Log(""10"")) = " & getVT(Log("10")))
Call ok(Approch(Log(CByte(2)), 0.6931), "Log(CByte(2)) = " & Log(CByte(2)))
Call ok(getVT(Log(CByte(2))) = "VT_R8", "getVT(Log(CByte(2))) = " & getVT(Log(CByte(2))))
Call ok(getVT(Date) = "VT_DATE", "getVT(Date) = " & getVT(Date))
Call reportSuccess()