We are currently working on syncing data between SuperOffice and our product, and we need clarification on how timestamps (such as creation and update dates) are handled in SuperOffice records.
-
Are timestamps always stored in Norway local time, or are they determined by tenant settings or the server location?
-
We understand that the
SO-Timezone
header can adjust timestamps when retrieving individual records. However, when fetching a list of entities, theSO-Timezone
header does not appear to affect the timestamps.- Is this behavior expected?
- Are there any alternative methods to ensure correct time conversion when working with lists of records?
Any insights or best practices would be greatly appreciated.
All Replies (5)
registered and updated timestamp are always in UTC, appointment start and end datetime depended on if timezones are configured/enabled.
See docs:
https://docs.superoffice.com/en/api/netserver/web-services/so-timezone.html
unfortunately the behavior is not as descripbed in the documentation. Please note that the testing was performed on an SOD environment.
Here is the details of my testing:
- Take note on current UTC and Norway time.
2. Using the SuperOffice Web update the a "Person entity" record
https://sod2.superoffice.com/
3. using SuperOffice API and check "UpdatedDate" value (WITHOUT "SO-TimeZone" header).
Observation: As you can see, the "UpdatedDate" is set to the current Norway local time instead of UTC.
Conclusion: The system does not behave as descripbed in the documentation.
But, when appying "SO-TimeZone" with value "includeTZOffset", the "UpdatedDate" is showing UTC value, contrarally to what the documentation stated that "the values are not affected by the TimeZone header". (The second sentence here might describe the behavior here, which implying the first sentense as incorrect)
However, the bigger problem is the "TimeZone header" does not work for "bulk Get" API endpoints. Please check the screenshot below:
This feature is crucial for our product integration with SuperOffice. Please advice. Thank you
Here is the screenshot of getting all person entity record including "SO-TimeZone" header to the request
Hi 99x Youtello developer,
Do you have timezones enabled? I'm going to assume not. Things do behave slightly differently dependent on that setting.
When timezones are enabled, and you ask to include timezone offset, you should see the following:
There is a little more info about timezones in the Headers section of docs.
When you have timezones enabled, and you include the So-Timezone header, with include TZ offset, try explicitly asking for UTC.
Then you should get the correct results:
You are able to determine what the current time zone is by checking the base, which will tell you the default offset. 404 means timezones are not enabled.
Hope this helps!