# Bug COSTS-59 - Time Entry creation via the API is not correctly handling user timezones

Project: Stream Time & Costs
Status: closed
URL: https://community.openproject.org/work_packages/COSTS-59

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 15.4.0 |
| Observed in versions |  |
| Bug found in version (deprecated) |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Klaus Zanders |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

While looking into <mention class="mention" data-id="60633" data-type="work_package" data-text="##60633">##60633</mention> <mention class="mention" data-id="71476" data-type="user" data-text="@Eric Schubert">@Eric Schubert</mention> found the following problem (copying from chat):

Hab noch eine Frage aus dem Test. Ich stelle sie erstmal hier, du schaust morgen drauf und dann überlegen wir, ob das was ist oder vielleicht nicht.

Wenn ich PATCH /time\_entries/:id mache, mit

\`\`\`json  
{  
 "startTime": "2025-01-30T12:00:00Z"  
}  
\`\`\`

gibs nen Fehler, weil ja der date part nicht mit \`spentOn\` übereinstimmt. Richtig, \`spentOn\` ist nicht im PATCH body gesetzt, aber es existierte schon im entry. Ein ding? Oder eher nicht?

Okay, jetzt mach ich mal nen full update:

\`\`\`json  
{  
 "hours": "PT2H",  
 "startTime": "2025-01-30T12:00:00Z",  
 "spentOn": "2025-01-30"  
}  
\`\`\`

Top, 200, läuft. Aber halt... In der response steht jetzt:

\`\`\`json  
{  
 "spentOn": "2025-01-30",  
 "hours": "PT2H",  
 "startTime": "2025-01-30T11:00:00.000Z",  
 "endTime": "2025-01-30T13:00:00.000Z"  
}  
\`\`\`

Da ist was schief gelaufen beim parsen meines inputs, oder? Ich hab ja explizit einen zulu timestamp angegeben.
