Vues :

Behavior:

With my Platform API Tool I access the indexvalues of a document. But the date values I get, do not match to the values I get in the DocuWare WebClient.


Cause:

DocuWare saves the date values in the database in the timezone UTC. The WebClient calculates the date automatically to meet the current timezone, the client PC runs in. The Platform API does not do this. It simply delivers the value of the database.


Solution:

There are different ways to adapt the value to the timezone, the client PC runs in. Here are two possible ways:

  1.  Get the difference between UTC and the timezone of the client PC and add this difference to the value of the database:
    DateTime dt = ...//Value of the database
    TimeSpan ts = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
    DateTime output = dt + ts;

     
  2. Use the method "ToLocalTime()" for Date or DateTime objects:
    DateTime dt = ...//Value of the database
    DateTime output = dt.ToLocalTime();