WELCOME TO THE COMMUNITY
find what you are looking for or ask a new question
Home > Forum > Latest posts

latest posts

Hi Arek,

Another workaround I use in my projects:

You can use Word’s built-in IF field functionality directly in the DOCX template to wrap entire blocks or even WEBCON item lists. I’ve attached a screenshot from one of my templates to show how it looks in practice.

In this example, I use a business rule that returns the count of approvers. The logic is:
{ IF "{Get Genehmiger count}" <> "0" "Display Table and Heading" "" }

As you can see in the image, the entire table and the "Genehmiger:" heading are placed inside the "True" part of the Word IF statement. If the count is "0", the whole block simply doesn't appear in the generated document.

Best regards,
Maryna

MVP
In reply to: Franek

I have run some tests and I haven’t found a simple solution or fully tested solution ;) The Webcon public API always returns datetime values in the server’s local time zone (as you mentioned). I think webcon unfortunately, works that way.
I assume that the client consuming the Webcon API is custom code that you fully control, so I think you could theoretically do something like this:

1. Get the time offset from Webcon by making an API GET request that returns an element with a datetime attribute. This can be a one‑time operation, and you can store the Webcon time offset locally on the client side.

2. Calculate the datetime that needs to be stored in Webcon and send it via an API POST request.

3. Get the datetime attribute from Webcon via an API GET request and convert it to the client’s local time.


//client local timezone
TimeZoneInfo clientZone = TimeZoneInfo.Local;


1. //get time offset from webcon from some element via api get
var dto = DateTimeOffset.Parse("2026-04-23T10:00:00+09:00");
TimeSpan webconOffset = dto.Offset;
Console.WriteLine(webconOffset);


2. //post datetime to webcon

var data = "2026-04-23T15:20:00";//datetime that must be stored in the webcon.

DateTime clientLocal = DateTime.Parse(data);
DateTime clientUtc = TimeZoneInfo.ConvertTimeToUtc(clientLocal, clientZone);

//convert datetime to the webcon local. That value should be sent via api post
string webconLocal = (clientUtc + webconOffset).ToString("yyyy-MM-dd'T'HH:mm:ss");
Console.WriteLine(webconLocal);


3. //get data from webcon

var webconDateTime = DateTimeOffset.Parse("2026-04-23T22:20:00+09:00");
DateTime webconUtc = webconDateTime.UtcDateTime;
clientLocal = TimeZoneInfo.ConvertTimeFromUtc(webconUtc, clientZone);
Console.WriteLine(clientLocal);


I have not tested how the datetime attribute will be presented on the portal or whether it will have the correct value.

Hi Franek,

thank you that you took the time to investigate it and confirm the behavior.

I also wasn't able to confirm how it looks like in the UI, as the servers and my client share the same settings. I will test it tomorrow, when I'm copying the solution to the customer environment which is using UTC time zone for the server, as I would have expected it. :)

Best regards,
Daniel

In reply to: Daniel Krüger (DCCS)

Hi Franek,

thanks for the feedback. That was exactly the approach I wanted to use.

This is the time I send via the REST API (patch/post)
"value": "2026-04-23T09:06:05Z"

But this is the time which is returned via the API (get)
"value": "2026-04-23T09:06:05+02:00"

Which is not what I had expect and comparing the dates obviously returned false. Which is the reason for my post. :)


Best regards,
Daniel

I have run some tests and I haven’t found a simple solution or fully tested solution ;) The Webcon public API always returns datetime values in the server’s local time zone (as you mentioned). I think webcon unfortunately, works that way.
I assume that the client consuming the Webcon API is custom code that you fully control, so I think you could theoretically do something like this:

1. Get the time offset from Webcon by making an API GET request that returns an element with a datetime attribute. This can be a one‑time operation, and you can store the Webcon time offset locally on the client side.

2. Calculate the datetime that needs to be stored in Webcon and send it via an API POST request.

3. Get the datetime attribute from Webcon via an API GET request and convert it to the client’s local time.


//client local timezone
TimeZoneInfo clientZone = TimeZoneInfo.Local;


1. //get time offset from webcon from some element via api get
var dto = DateTimeOffset.Parse("2026-04-23T10:00:00+09:00");
TimeSpan webconOffset = dto.Offset;
Console.WriteLine(webconOffset);


2. //post datetime to webcon

var data = "2026-04-23T15:20:00";//datetime that must be stored in the webcon.

DateTime clientLocal = DateTime.Parse(data);
DateTime clientUtc = TimeZoneInfo.ConvertTimeToUtc(clientLocal, clientZone);

//convert datetime to the webcon local. That value should be sent via api post
string webconLocal = (clientUtc + webconOffset).ToString("yyyy-MM-dd'T'HH:mm:ss");
Console.WriteLine(webconLocal);


3. //get data from webcon

var webconDateTime = DateTimeOffset.Parse("2026-04-23T22:20:00+09:00");
DateTime webconUtc = webconDateTime.UtcDateTime;
clientLocal = TimeZoneInfo.ConvertTimeFromUtc(webconUtc, clientZone);
Console.WriteLine(clientLocal);


I have not tested how the datetime attribute will be presented on the portal or whether it will have the correct value.

Hi, I present some other perspectives outside Webcon. I have built several web applications and I have always saved datetime values in UTC without a timezone due to the issues you mentioned. On the frontend, I calculated the correct local datetime depending on the client’s timezone. You only need to remember that the datetime stored in the database is saved in UTC, and the rest should be handled on the frontend. You can also store the client's time zone in a text column if you need to do time‑related calculations on the backend.

This approach worked well for me.

MVP

Hi everyone,

whenever you are working with times you are bound to run into issues. I think this has and will be a permanent truth when working with computers.

I currently "just" want to write a date time to an item list column and won't to return the same value. Seems simple, but time zones are proving to be a problem.

For the column "Enable time selection" and "Use time zone settings" has been enabled.

I'm updating the workflow instance with this value:
{
"guid": "0e8c5c68-7f88-43a2-b5ff-0d91e4eb051c",
"value": "2026-04-23T09:06:05Z"
},

This represents 9:06:05 UTC on my client this equals 11:06:05 local time (UTC+1:00 Amsterdam, Berlin...)

In the database it's saved with this time:
2026-04-23 09:06:05

When I'm fetching the element again via REST API i get this result:
{
"id": 331,
"guid": "0e8c5c68-7f88-43a2-b5ff-0d91e4eb051c",
"svalue": "2026-04-23T09:06:05.0000000+02:00",
"value": "2026-04-23T09:06:05+02:00"
},


This represents 7:06:05 UTC / 09:06:05 local time (UTC+1:00 Amsterdam, Berlin...)

The SQL server and WEBCON share the same machine and for whatever reason the time zone is also set to (UTC+1:00 Amsterdam, Berlin...).

The global parameter is also set to the equivalent time zone:
PRM_Name PRM_Value
DatabaseTimeZone W. Europe Standard Time


It sems, that the saved date time value is treated as local time of the server and the time zone offset is just added. While this makes sense to agree. It doesn't make sense when that the send UTC time is not converted to the local time.

Am I missing something or has someone a better idea on how I can utilize the public API and get the correct time?

It can't be, that the client has to send the times in the time zone the server is running. How should a consumer of the REST API know this?

Edit:
Current workaround, which I don't like at all:
# For some reason WEBCON does return the send UTC time with the time zone offset
$savedModifiedDate = [datetime]::Parse($modifiedDateCell.value.substring(0, 19) + 'Z')

Best regards,
Daniel