Hello,

It seems that I simply can't find a way of converting a JS date to a
meaningful thing inside C++. Suppose you have the following script:

--start JS code--
function return_a_date()
{
  return new Date();
}
--end JS code--

--start c++ code--
Handle<Function> function = Handle<Function>::Cast(
            _context->Global()->Get(String::New("return_a_date")));
Local<Value> callResult = function->Call(...);
--end c++ code--

Now, how do you get the number of something (seconds,milliseconds)
starting from some date (usually 1970) and make use of it inside C++?

I've tried the following:
--start c++ code--
Local<Date> date = Local<Date>::Cast(callResult);
DEBUG("Number: %f", date->NumberValue());
--end c++ code--

It always outputs me:

Number: 312854400000.000000

Which is meaningless IMHO.
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to