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

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 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.

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 (1,592)