cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iwonder
Impactful Individual
Impactful Individual

PC is DD-MM-YYYY, Phone is MM-DD-YYYY

Thank you for taking the time to read my question.

 

I am making an app that uses @ShaneYoung (PowerApps Calendar Control - Build your own using Galleries - YouTube) video on custom galleries (Thanks Shane!). It works well on my PC which is formatted as day month year, but when I test it on my phone, I find out that my phone (iPhone 😎 is formatted as month day year. As a result my DateAdd() calculations are wrong on my phone but right on my PC.

 

Do I need to detect what the device is set to?

Is there a way to work around this?

 

example: 

Set(varFirstDayOfMonth,DateValue("1/" & Month(Today()) & "/" & Year(Today())));

 

On my PC I get: 1/12/2021

on my phone I get: January 12, 2021

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@iwonder 

Yes, stay away from doing text based dates.  Use the functions to provide just dates without needing a format.

You can also add language codes to the functions to convert based on a specific region.

Set(varFirstDayOfMonth, Date(Year(Today()), Month(Today()), 1));

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@iwonder 

Yes, stay away from doing text based dates.  Use the functions to provide just dates without needing a format.

You can also add language codes to the functions to convert based on a specific region.

Set(varFirstDayOfMonth, Date(Year(Today()), Month(Today()), 1));

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
iwonder
Impactful Individual
Impactful Individual

Hi @RandyHayes 

 

RIGHT after I posted it hit me 🙂

 

Thank you so much for the reply. I realized I needed to do exactly what you suggested.

 

have a great day.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,573)