cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Spinner
Advocate II
Advocate II

Date Picker off by 23 hours when its DateTimeZone is set to UTC - bug?

I've run in to what I think is a bug in DatePicker.

 

I live in the UK, so I currently am on UTC+1 (British Summer Time).

 

When I set a Date Picker's DateTimeZone property to DateTimeZone.Local, SelectedDate shows the same date, and Text() function converts this to a UTC time 1 hour compared to what it would be in my local time. All correct.

 

However, when I set its DateTimeZone property to DateTimeZone.UTC, SelectedDate shows a date one day before. Text() duly converts this to a time wrong by 23 hours.

firefox_bS4OnkvIvs.png

Am I right in thinking this is indeed a bug?

2 REPLIES 2
iltoningui
New Member

Hi @Spinner,

 

This behaviour is due to the fact that the selected value is actually datetime and not date.

The default value is TODAY() returns the current datetime 21/07/2021 00:00:00 at midnight if you change the time zone in this conditions it might affect the date.

 

If you are not using the component to select date not time, you should stick with Local as your time zone.

 

Hello @iltoningui,

 

Thank you for the reply.

 

I don't think it is related to the default value: this apparent error occurs whichever date I select (see below for an example on a different day).

firefox_XHNiNiUQc6.png

As you can see, after selecting 1 July 2021 in dte_2, the datetime value stored in SelectedDate is a whole day off what I would expect it to hold. Instead of 2021-07-01T00:00:00.000Z, it shows 2021-06-30T00:00:00.000Z.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,103)