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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

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