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

Date conversion issues when adding a calendar event

Hi,

 

I'm having problems with converting of dates in powerapps. I have the below but it won't recognise the inputs as a date when creating the calendar invite if I hover over the date in the code it brings up 28/01/2022 for today this is correct but when I run it, it returns an error.

 

If I change the format to mm/dd/yy and change my browser language to en-us it works. If I change browser language back to en-GB and switch it back to dd/mm/yy it fails to work. If I keep the browser language as En-GB and use mm/dd/yy in the code it creates a calendar invite in a couple of years time.

 

What I want ideally is for powerapps to overide the browser language and always use dd/mm/yy format to write the calendar invite. 

 

The date picker format is dd/mm/yy

 

MJ84_1-1643366204333.png

 

uber confused! 

 

thank you in advance

 

Matt

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

@MJ84 

My suggestion here is to pass the date in yyyy-mm-dd format, because that will work irrespective of whether the browser is set to en-GB or en-US.

The syntax to set the start datetime would look like this:

Text(DateTimeValue(
        Text(DatePickerCity_1.SelectedDate, "yyyy-mm-dd") & " 08:00:00"
     ),
     DateTimeFormat.UTC
)

View solution in original post

2 REPLIES 2
timl
Super User
Super User

@MJ84 

My suggestion here is to pass the date in yyyy-mm-dd format, because that will work irrespective of whether the browser is set to en-GB or en-US.

The syntax to set the start datetime would look like this:

Text(DateTimeValue(
        Text(DatePickerCity_1.SelectedDate, "yyyy-mm-dd") & " 08:00:00"
     ),
     DateTimeFormat.UTC
)

@timl This is exactly what I needed - thanks for taking time to reply 👍

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,456)