I am working on C++ Addon and am trying to set the various DATE fields
CallDateMethod (date, "setUTCFullYear", year).;
CallDateMethod(date, "setUTCMonth", month);
CallDateMethod (date, "setUTCDate", date);
CallDateMethod (date, "setUTCHours", hours);
CallDateMethod (date, "setUTCMinutes", mins);
CallDateMethod (date, "setUTCSeconds", secs);
where the CallDateMethod is as follows:
void CallDateMethod (v8::Local::<v8::Date> date, const char *method, int v)
{
Handle<Value> args[1];
args[0] = v8::Number::New (v);
Local<Function>::Cast (date->Get(String::New (method)))->Call (date, 1, args);
}
year, month, date, hours, mins, secs are good, have verified,
and printing this in js script, consistently shows a wrong value.
Any suggestion how to set values in v8::Date?
Thanks,
-P. Venkatraman.