Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 72

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?

  • Spinner Profile Picture
    Spinner 72 on at
    Re: Date Picker off by 23 hours when its DateTimeZone is set to UTC - bug?

    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.

  • iltoningui Profile Picture
    iltoningui 247 on at
    Re: Date Picker off by 23 hours when its DateTimeZone is set to UTC - bug?

    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.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard