Forum Discussion

Audric's avatar
Audric
New Contributor
6 years ago
Solved

Swagger auto convert date time in UTC

Hello,

 

I've got a problem using Swagger for my API.

In a in-parameter (of a GET method), I've got a datetime that people can give to the API, for example '2019-03-22T23:00:00Z'.


But when I look at what swagger API receive in the parameter, I've got '2019-03-23 01:00:00'.
It look like swagger want to convert it in UTC datetime, but what I want it's just to keep the same datetime value, without using the time zone.

 

The date have one day difference and that's very annoying for me...

 

How can I do ?
Thanks !

Audric

  • Audric's avatar
    Audric
    6 years ago

    Hello,

     

    I'm sorry, I didn't know that.
    I'm using the package Nuget SwashBuckle AspNetCore with the web interface for my .Net/C# API.

    Thanks !

    EDIT : it look like it's not due to swagger but JSON formatter. I close it.

2 Replies

  • Swagger is a set of tools, not a specific one. Which one are you referring to?

    • Audric's avatar
      Audric
      New Contributor

      Hello,

       

      I'm sorry, I didn't know that.
      I'm using the package Nuget SwashBuckle AspNetCore with the web interface for my .Net/C# API.

      Thanks !

      EDIT : it look like it's not due to swagger but JSON formatter. I close it.