cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShriAzure
Regular Visitor

Retreiving DateTime value from SharePoint List

 

I am trying to create a powerapp to display values from a SharePoint List. It auto-converts the datetime values to UTC and I couldn't get it to show them in the local time zone.

 

 SharePoint List value7/14/2017 12:00 AM  (Central Time)
PowerApps display value7/13/2017 07:00 PM (UCT)

 

I tried to manually add +5 hours to the time but there doesn't seem to be a TimeAdd function like DateAdd.

 

Do we have any workaround?

 

Thank you!

 

Shri

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Retreiving DateTime value from SharePoint List

Hi @ShriAzure,

 

 

Check to see if the following article would be helpful:

DateAdd, DateDiff, and TimeZoneOffset functions in PowerApps

 

If you using PowerApps Studio, and the local time zone is the same as the time zone under the SharePoint site, then PowerApps should handle the Time correctly without any modification.

 

Further, if the time displays in the wrong timezone, please take use of the TimeZoneOffset function to convert from/To UTC:

To convert to UTC (Coordinated Universal Time), add the TimeZoneOffset for the given time.

DateAdd( TimeVariable, TimeZoneOffset(), Minutes )

To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.

DateAdd( TimeVariable, -TimeZoneOffset( StartTime ), Minutes )

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Retreiving DateTime value from SharePoint List

Hi @ShriAzure,

 

 

Check to see if the following article would be helpful:

DateAdd, DateDiff, and TimeZoneOffset functions in PowerApps

 

If you using PowerApps Studio, and the local time zone is the same as the time zone under the SharePoint site, then PowerApps should handle the Time correctly without any modification.

 

Further, if the time displays in the wrong timezone, please take use of the TimeZoneOffset function to convert from/To UTC:

To convert to UTC (Coordinated Universal Time), add the TimeZoneOffset for the given time.

DateAdd( TimeVariable, TimeZoneOffset(), Minutes )

To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.

DateAdd( TimeVariable, -TimeZoneOffset( StartTime ), Minutes )

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

ShriAzure
Regular Visitor

Re: Retreiving DateTime value from SharePoint List

Thanks! This worked.. PowerApps Studio, SharePoint site are in the same local time zone. The SharePoint is hosted in the cloud (Office 365) if something that made PowerApps didn't auto-handle the time.

 

Thanks again! Your quick response is highly appreciated.

 

Shri

NPBA_AT Helper II
Helper II

Re: Retreiving DateTime value from SharePoint List

Can you please advise what is good practise for storing and displaying dates and times in this scenario. We are a global organisation, our Offfice 365 tenancy is in the USA and I am writing Powerapps for use in New Zealand. The Language() function returns "en-US" which is not correct for our users. There is no language tag for New Zealand. How is this best managed?

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,275)