DateTime, time zone?

Hello Remobjects team,

I’ve noticed that if my Remobjects SOAP server publishes a function that returns a DateTime, the plain vanilla Delphi WSDL importer (D2009) will interpret it as UTC and adds my timezone offset to the result. Is there anything I can do to avoid that? Does Remobjects include timezone information in the SOAP result?

In this case need to use XsDateTime type instead of simple DateTime.

Thanks, will do!

Hi there

Using XsDateTime (instead of simple DateTime), how do I have to pass the date and the time in JavaScript?

WilfyAgentService.prototype.SetScheduleData = function(
CompanyId,
DepartmentId,
ScheduleNow,
ScheduleDateTime,
__success, __error) {
try {
var msg = this.fMessage.clone();
msg.initialize(this.fServiceName, “SetScheduleData”);
msg.write(“CompanyId”, “Int64”, CompanyId);
msg.write(“DepartmentId”, “Int64”, DepartmentId);
msg.write(“ScheduleNow”, “Boolean”, ScheduleNow);
msg.write(“ScheduleDateTime”, “XsDateTime”, ScheduleDateTime);
msg.finalize();
this.fChannel.dispatch(msg, function (__message) {
var __result = __message.read(“Result”, “Boolean”);
__success(
__result
);
}, __error);

} catch (e) {
    __error(msg, e);
};

};

Thanks,
P.

Unfortunately, RO/JS doesn’t support XsDateTime at the moment. Logged as #55337: ro/js: implement XsDateTime serialization

As a temporary solution you could manually change type back to DateTime and add time zone offset. Something like

//msg.write("ScheduleDateTime", "XsDateTime", ScheduleDateTime); ScheduleDateTime = new Date(ScheduleDateTime.getTime() + ScheduleDateTime.getTimezoneOffset() * 60000); msg.write("ScheduleDateTime", "DateTime", ScheduleDateTime);

Thanks, this works!