Skip to main content
1-Visitor
October 6, 2015
Question

How to fix DateTime property timezone in mashup?

  • October 6, 2015
  • 5 replies
  • 4444 views

I've a console application sending data to ThingWorx service using .NET SDK, that adds those calls as an infotable property row.

From the .NET app I debug the logs from the parameters send to the service and the dateTime seems ok but on ThingWorx mashup where I list the rows from that property in a grid, there's three hours offset.

I've checked that the timezone is correct on the server running ThingWorx and tried using DateTime.SpecifyKind function in .NET to specify the time as DateTimeKind.Utc / DateTimeKind.Local before invoking the service with those parameters but nothing seems to be working.

Could someone tell me how to get rid of this +3h offset? I'm trying to track live events from a sensor on mashup but it's kinda annoying to always get the time three hours in the future.

5 replies

1-Visitor
October 6, 2015

The Thingworx server uses UTC, and then browser side that information is translated into the Time zone of the browser.

Since you already made sure that UTC is correct on the server, then most likely the SDK is submitting time that is not UTC or the device is not set correctly?

miikkae1-VisitorAuthor
1-Visitor
October 13, 2015

The device talking to TWX SDK is outputting correct local time and in the program I escpecially set


DateTime.SpecifyKind(date, DateTimeKind.Utc);



The timezones are checked and correct in

  1. Current browser
  2. Device communicating to ThingWorx SDK
  3. ThingWorx server

They are even all in the same timezone. Got no idea where the -3 hours come from.

1-Visitor
October 13, 2015

Is the property bound? or do you do any handling with the date/time before storing it?

I would log the value at each step to the script log just to see if at anytime it changes at all.

Beyond that I am not sure what might be going on with your setup.