cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kevinsray
Level: Powered On

Date not showing correctly

In my app, I have a label showing a date. The text property for this is:
Text(Last(SortByColumns(Filter(CAMR, CAMR_Task_ID=CAMT_Task_ID),"CAMR_Date",SortOrder.Ascending)).CAMR_Date,"[$-en-US]dd/mm/yyyy")

However, if the date is past 2pm, it shows the next day.

e.g. date in Db is 17th, but shows 18th if the date in DB is past 2pm.

I am in a timezone which is +10 UTC, so I am guessing this is the problem, but not sure how to fix my properties field.

Any advice would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
kevinsray
Level: Powered On

Re: Date not showing correctly

Thank you all for your feedback.

With this information I was able to resolve the problem I believe.

FYI, this is the code that ended up showing the date as I expected.

 

Text(DateAdd(Last(SortByColumns(Filter(CAMR, CAMR_Task_ID=CAMT_Task_ID),"CAMR_Date",SortOrder.Ascending)).CAMR_Date,-10,Hours),"[$-en-US]dd/mm/yyyy")

View solution in original post

6 REPLIES 6
AndySid
Level 8

Re: Date not showing correctly

Is your data Sharepoint, if so have you set the timezone?

kevinsray
Level: Powered On

Re: Date not showing correctly

Andy,

Sorry, I should have specified.

The date is saved as local time on a SQL table.

AndySid
Level 8

Re: Date not showing correctly

Community Support Team
Community Support Team

Re: Date not showing correctly

Hi @kevinsray,

 

Your app time is showing different from your DB?

That is because the UTC.

You can use function TimeZoneOffset to test how many minutes they are difference.

 

I test as next:

Text(DateAdd( Now(), TimeZoneOffset(now()), Minutes ),"[$-en-US]dd/mm/yyyy") (now() is the time I test)

 

By your side:

Text(DateAdd( CAMR_Date, TimeZoneOffset(CAMR_Date), Minutes ),"[$-en-US]dd/mm/yyyy")

 

Hope this can be helpful.

Best Regards,

Yumia

 

kevinsray
Level: Powered On

Re: Date not showing correctly

Yumia, Thank you. I know there is 10 hours difference. Time in DB is local time, but PA is showing +10 hours. I understand there is timeoffset, I just can`t figure out how to incorporate it with my current formula. Text(Last(SortByColumns(Filter(CAMR, CAMR_Task_ID=CAMT_Task_ID),"CAMR_Date",SortOrder.Ascending)).CAMR_Date,"[$-en-US]dd/mm/yyyy")
kevinsray
Level: Powered On

Re: Date not showing correctly

Thank you all for your feedback.

With this information I was able to resolve the problem I believe.

FYI, this is the code that ended up showing the date as I expected.

 

Text(DateAdd(Last(SortByColumns(Filter(CAMR, CAMR_Task_ID=CAMT_Task_ID),"CAMR_Date",SortOrder.Ascending)).CAMR_Date,-10,Hours),"[$-en-US]dd/mm/yyyy")

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 409 members 5,629 guests
Please welcome our newest community members: