cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chipper
Helper II
Helper II

Date Rolls Back A Day

I am working with converting/formating a date and all seems good, but then it rolls back a day.

 

Screen Shot 2022-03-01 at 3.10.09 PM.png

 I thought it may be the timezone setting, but when I changed it, nothing changed.  Still one day back.

 

 I even tried the long date version and it shows 8pm thinking it may have something to do with the time.

 

Screen Shot 2022-03-01 at 3.15.54 PM.png

 

Thank you for your thoughts.

1 ACCEPTED SOLUTION

Accepted Solutions

If you are not already doing so, when reading DateTime from Excel you can set the format to be ISO 8601 - which should format the Excel's integer dates (such as  44657) to the pattern YYYY-MM-DDTHH:MM:SS:xxxZ. All Dates and Times are considered Universal Time Code (UTC) for ISO 8601 and this explains the '”Z” at the end.

See: Excel Date changes in Power Automate 

 

Snag_d7966e.png

I'm still not clear why you are trying to "converting" from Eastern Standard Time to Eastern Standard Time in your flow. However, if all your dates are in Eastern Time the you could drop the Z at the end of the date time string and you should be able to see that the time does not roll back. You can use formatDateTime to do this:

Snag_b3d71.png

 

formatDateTime('2022-04-06T00:00:00.00Z','yyyy-MM-dd')

 

 

Snag_e028c.png

Hope this helps.


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
ekarim2020
Super User
Super User

I suspect that this is due to the Z specifier in the baseTime? If your datetime has a "Z" at the end, it means it is in UTC time. Try removing the Z specifier.

 

However, I don't understand what you are trying to achieve by "converting" from Eastern Standard Time to Eastern Standard Time in the Convert time zone action.

 


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

 I am passing a date from excel.

Screen Shot 2022-03-01 at 4.42.39 PM.png

 

And then get this.

 

Screen Shot 2022-03-01 at 4.44.04 PM.png

 

I changed the time zones like you suggested and still get the same result.

If you are not already doing so, when reading DateTime from Excel you can set the format to be ISO 8601 - which should format the Excel's integer dates (such as  44657) to the pattern YYYY-MM-DDTHH:MM:SS:xxxZ. All Dates and Times are considered Universal Time Code (UTC) for ISO 8601 and this explains the '”Z” at the end.

See: Excel Date changes in Power Automate 

 

Snag_d7966e.png

I'm still not clear why you are trying to "converting" from Eastern Standard Time to Eastern Standard Time in your flow. However, if all your dates are in Eastern Time the you could drop the Z at the end of the date time string and you should be able to see that the time does not roll back. You can use formatDateTime to do this:

Snag_b3d71.png

 

formatDateTime('2022-04-06T00:00:00.00Z','yyyy-MM-dd')

 

 

Snag_e028c.png

Hope this helps.


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

Really the only reason I was using the converting time zone was for the formatting of the date and time.  I found that before I learned from you that I could do what I needed using the expression.

 

Thank you for helping and teaching me.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,141)