cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WillPage
Level 8

Convert time zone date format

Hello.

I need to convert a time from NZST to UTC, but the date format is d/mm/yyyy and the Convert time zone function is picking the wrong part of the date as the day.

 

Capture.PNG

In this screen shot, the baseTime is 5/04/2019 2:46:15 AM - this is the 5th day of April. I'm converting to UTC so I want the output to be 4/4/2019 2:46:15 PM, not 5/3/2019 as it appears in the screen shot above.

 

I looked at all the available formatstrings, and none have the date format the british way around.

 

Is there a way of doing this without building the baseTime string with a series of complicated splits and concats from the original data?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Convert time zone date format

Hi @WillPage,

 

Please take a try to split the date time, and you could refer to link below to do it:

https://powerusers.microsoft.com/t5/Building-Flows/Flow-failing-when-converting-quot-dd-MM-yyyy-quot...

 

Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
Super User
Super User

Re: Convert time zone date format

Hello @WillPage,

 

This is the biggest pain in the a.. of Flow. DateTime and working with it, especially when you are trying to deploy solution cross the world.

 

As far as I know, there is no simple way hot to transfer different notation of DateTime into the Flow one. You have to go throught first splits, middle splits and then to combine it again.

 

I highly siggest you to create Idea for it here - https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas.

P.

Super User
Super User

Re: Convert time zone date format

Hi @WillPage, have you tried using the Convert Time Zone action? 

ConvertTimeZone.jpg

 

Rob

Dorul
Level 8

Re: Convert time zone date format

Hi @WillPage

I guess you need to change your format string:

Capture.JPG

 

 

 

 

 

 

With your choice General pattern date/time, I get 1/21/2019 12:55 PM too. Try that format string, as it is in my printscreen, it shows me the result 21/01/2019 12:58:15.





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Super User
Super User

Re: Convert time zone date format

Hello @WillPage again,

 

My fault I missed this option in this action as described by @Dorul you can change formatstring to your datetime.

 

Big apologise.

Pavel

WillPage
Level 8

Re: Convert time zone date format

@vecerpaUnfortunately this does not work. It swaps the day and month around on the output only:

 

Capture

 

WillPage
Level 8

Re: Convert time zone date format

Further to this, if I set a date as the input that can't be interpreted incorrectly (e.g the day of the month > 12th), I see this:

Capture.PNG

Community Support Team
Community Support Team

Re: Convert time zone date format

Hi @WillPage,

 

You couldn't enter a date with type d/mm/yyyy in the flow, and the flow would always see the date with type m/dd/yyyy.

 

So please enter a date with type mm/dd/yyyy in the flow if you would like the flow could identify your date.

 

Best regards,

Alice

 

WillPage
Level 8

Re: Convert time zone date format

@v-yuazh-msftthat would be the obvious solution if I could control the input, but unfortunately I have to work with this date format.

Community Support Team
Community Support Team

Re: Convert time zone date format

Hi @WillPage,

 

Please take a try to split the date time, and you could refer to link below to do it:

https://powerusers.microsoft.com/t5/Building-Flows/Flow-failing-when-converting-quot-dd-MM-yyyy-quot...

 

Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

WillPage
Level 8

Re: Convert time zone date format

@v-yuazh-msft Thanks. I was hoping it wouldn't come to split and recombining them but it will work. I have asked a question in the other thread.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,925)