JetBrains / YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
https://www.jetbrains.com/youtrack
Apache License 2.0
135 stars 105 forks source link

Wrong Json Conversion in UnixDateTimeOffsetConverter #51

Closed ptrushin closed 7 years ago

ptrushin commented 7 years ago

In https://confluence.jetbrains.com/display/YTD4/Timestamps+in+REST+API

For any timestamp in REST API, YouTrack uses Java timestamp format: The number of milliseconds

But in https://github.com/JetBrains/YouTrackSharp/blob/master/src/YouTrackSharp/Json/UnixDateTimeOffsetConverter.cs in method WriteJson I see ".ToUnixTimeSeconds()" and because of this when I do timeTrackingService.CreateWorkItemForIssue("MA-2633", new WorkItem(new DateTime(2017, 1, 1), TimeSpan.FromHours(0.5), "")) then I have a result with date 18 Jan 1970 in YouTrack

maartenba commented 7 years ago

You are absolutely right! We'll get that fixed.

maartenba commented 7 years ago

Released in https://github.com/JetBrains/YouTrackSharp/releases/tag/3.0.1