web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Date/time format chang...
Power Automate
Unanswered

Date/time format changing when using custom connector and on-premises gateway

(0) ShareShare
ReportReport
Posted on by 53

Edit: After making some changes to the swagger file which didn't help, I put back my original swagger file and deleted and added the action to use the custom connector in my flow and to my surprise it is now working!  I cant understand what is different.  I have not been doing anything with the date formats - the values in the request have been a copy and paste of the original values on the item I am updating with this request. 

 

I have an issue with a flow that is sending a request via a custom connector using on-premises gateway.  There are two date/time values sent in the request.  They are sent in YYYY-MM-DDTHH:MM:SS.SSSZ format which is what the endpoint expects.  Checking my flow history I see these values being sent to my custom connector (from the raw input of the step that calls the custom connector):

 

        "request/validFor/endDateTime": "2023-12-30T11:00:00.000Z",

        "request/validFor/startDateTime": "2022-11-15T00:30:00.000Z",

 

When the request is received at the endpoint after going through the custom connector and the on-premises gateway, I see that the format of theses values has changed to YYYY-MM-DDTHH:MM:SSZ.  This results in failure as the endpoint can’t parse the times correctly.  This is what is received by the endpoint:

 

“validFor": {

    "endDateTime":"2023-12-30T11:00:00Z",

    "startDateTime":"2022-11-15T00:30:00Z"

}

 

I have used the Test page on the custom connector and if I enter these values in the request in the expected YYYY-MM-DDTHH:MM:SS.SSSZ format, the formatting is retained and the endpoint responds correctly.  So I believe the reformatting is not anything to do with the on-premises gateway.

 

I don’t understand what is causing this format to change.  Does anyone have any suggestions?

 

In case it matters, here are relevant extracts from the operation definition in the custom connector Swagger 2.0 file:

 

In the operation definition:

          schema:

            $ref: '#/definitions/UpdateProductOfferRequest'

 

  UpdateProductOfferRequest:

    type: object

    required:

      - id

      - lifecycleStatus

      - name

      - validFor

 

The property ‘validFor’ is defined as

      validFor:

        description: >-

          The period for which the Product is valid for

        $ref: '#/definitions/TimePeriod'

 

The TimePeriod is defined as:

 

TimePeriod:

    type: object

    required:

      - endDateTime

      - startDateTime

    properties:

      endDateTime:

        type: string

        format: date-time

        description: End date of the Entity.

      startDateTime:

        type: string

        format: date-time

        description: Start date of the Entity.

    title: TimePeriod

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,551 Super User 2026 Season 1 on at

    In Power BI that's not a datetime string, it is a datetimezone string.  Not sure if Power Automate makes the same distinction.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard