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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Disparity between shown date and actual date

(0) ShareShare
ReportReport
Posted on by 33

Hello. Today I came onto an issue relating to dates.

 

I'm loading a dataverse table from an API. The date from the API comes as a string, like "yyyyMMdd", e.g "20221125".

I then slice that string 3 times and concatenate it to have the string "25/11/2022", and then use parseDateTime function to convert it to "date" data-type.

 

However, when that data is loaded onto the table I get an odd result as shown here:

Adehmar_6-1669411169399.png

As you can see, the date value shown in the table is offset by 1 day before. Instead of the correct "01/01/2021", I get "31/12/2020" shown, and a complete different format in the actual value. That happens to every date in every registry I load. So for example, "25/11/2022" is shown as "24/11/2022" and it's actual value is 2022-11-25T00:00:00Z".

 

This is undesirable as I have to filter some information within a date range and the results are all wrong.

Adehmar_1-1669409959521.png

This is information from the loaded table, they all should be "01/01/2021".

Adehmar_5-1669411071785.png

 

This is the expression used to parse the date. I think the error is here. I don't get anything else related to dates from the API other than that string.

 

Can someone help me figure it out? The steps I want are:

 

1. Get string in yyyyMMdd, e.g, "20221125",

2. Transform it to string "25/11/2022", and then parse that string into "date" format

3. Load it into an "date-only (no time)" data-type column. I don't care about time, just dd, MM and yyyy.

 

Up until step 2, it's done successfully. Input is the string, then expression converts it to the desired format:

Adehmar_4-1669410923775.png

So error must be on the parseDateTime previously mentioned or some other behavior I'm not aware of.

 

Thank you in advance.

I have the same question (0)
  • grantjenkins Profile Picture
    11,059 Moderator on at
    Re: Disparity between shown date and actual date

    Can you try the following expression to convert your date string. I've put it into yyyy-MM-dd format and left it as the default time-zone as think this might be part of the issue with the difference in dates.

     

    parseDateTime(concat(slice(variables('date'), 0, 4), '-', slice(variables('date'), 4, 6), '-', slice(variables('date'), 6)))

     

    grantjenkins_0-1669433456390.png

     

  • Adehmar Profile Picture
    33 on at
    Re: Disparity between shown date and actual date

    Unfortunately this doesn't work. It has the same result.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard