Commit 8833177f0ad48e2aab23b11756bc5aba2dee67da

  • avatar
  • Sergey 'Jin' Bostandzhyan <jin @deve…per.digitalstrom.org>
  • Sun Aug 08 17:52:05 CEST 2010
Seconds since epoch must be in UTC

Turned out that JavaScript Date objects that are created from epoch
counter are always in UTC. If we were to return local time here, one
would have to recalculate that manually in JS to generate a correct Date
object.

So we will return UTC here and document this accordingly, in order to
make life of JS people a little easier.
core/web/handler/systemrequesthandler.cpp
(1 / 1)
  
3737 return success(DSS::getInstance()->versionString());
3838 } else if (_request.getMethod() == "time") {
3939 std::stringstream s;
40 s << DateTime().fromUTC().secondsSinceEpoch();
40 s << DateTime().secondsSinceEpoch();
4141 return success(s.str());
4242 }
4343 throw std::runtime_error("Unhandled function");
core/web/webserverapi.cpp
(1 / 1)
  
310310 .withDocumentation("Returns the dss version",
311311 "This method returns the version std::string of the dss");
312312 clsSystem.addMethod("time")
313 .withDocumentation("Returns the dSS time in seconds since epoch");
313 .withDocumentation("Returns the dSS time in UTC seconds since epoch");
314314
315315 RestfulClass& clsSet = api->addClass("set")
316316 .withInstanceParameter("self", "string", false);