cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
barlowse
Advocate IV
Advocate IV

Date/Times in Sharepoint List - converting

I a perplexed, and hope someone can share their wisdom.

I have a sharepoint list on a site in the Eastern Time Zone.

I have users in the Pacific Time Zone that also use this same list. 

I have changed the Site settings to allow the users to set their regional settings to their desired time zone. (Viewing of the list is not right for users; but that's another issue).

When a Pacific Time zone person adds data to this list, they value 3 date/time fields. 
If the user selects 06/30/2021 17:00 (5pm to them) as the time. 

A Flow is triggered to take the data for the item from the sharepoint list and create a file using html.
For the datetime field I do this formula:

if(equals(length(String(outputs('Get_item')?['body/Load_x0020_Arrival_x0020_Time'])),0),'',formatdatetime(convertFromUtc(outputs('Get_item')?['body/Load_x0020_Arrival_x0020_Time'],variables('TimeZone')),'MM/dd/yyyy hh:mm'))

The variable TimeZone has its value 'Pacific Standard Time'.

What comes out on my document is this: 06/30/2021 03:00

I must be missing another piece in my formula but can't figure out what it needs.
Any experts help is appreciated.

 

9 REPLIES 9
PrasadAthalye
Super User
Super User

Can you confirm what do you mean by this? What setting are you referring to?

"I have changed the Site settings to allow the users to set their regional settings to their desired time zone"

 

Please note that SharePoint stores all times in UTC format. So when User from Pacific stores data as 5 PM their time, SharePoint writes it in UTC format.  If you are intending it to convert it, you can convert it to Pacific time.

 

Use this action and see if it is helpful. In my case, I have Site Settings set to Pacific so everything displayed within the site is in pacific time. I am in Eastern time zone and I saved the date as 8:05 AM. Now when I convert it as below, I am getting 8:05 AM back. 

 

PrasadAthalye_0-1625157390243.png

 

Compose below shows saved date in UTC format as is without any formatting.

Convert now shows converted date in Eastern Time zone.

PrasadAthalye_1-1625157602247.png

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
barlowse
Advocate IV
Advocate IV

Site setting - my brain is frazzled - ignore that statement earlier.
Here are some screen shots of what I have going on.
I did add the Convert TimeZone action in my flow.
The west coast user enters in 17:19 (5:19 pm) 
entry form date.JPG
The Sharepoint List shows this
sp_list_display_of_date.JPG
I have this step in my flow
converttimezone.JPG
I get this as the result
converttimezone_result.JPG
I also tried this - just convert it to Eastern Time.
easterntimeconversion_result.JPG
I just want it to say 5:19 pm - I could subtract an hour but will that work everytime?

Which time zone you are interested in? Is it Pacific US? If yes, Can you use Pacific time US Canada?

 

PrasadAthalye_0-1625165020619.png

 

I see that you selected something that is giving pacific time Mexico...

 

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
barlowse
Advocate IV
Advocate IV

I do want Pacific Mexico.

 

barlowse
Advocate IV
Advocate IV

But what I really want is what the user picked. If they pick 17:19 it should be 5:19 pm.

 

Can you tell me where is the user? in Pacific time Mexico? Because I see an issue in offset. 6/30 5:19 PM should be saved as 7/1 1:19 AM since its an 8 hours offset. But in your screen shot it shows based time as 22:19 which is just 5 hours offset. 

 

Can you add a compose just before convert time and map Load start time and upload picture? 

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
barlowse
Advocate IV
Advocate IV

Thank you PrasadAthalye for sticking with me. Much appreciated!
I went back to beginning. I think because I am in the Eastern time zone and testing this I was not mimicing things as my west coast user correctly.
My Sharepoint Site settings
sitesettings.JPG

My regional settings

Myregionalsettings.JPG

my browser settings

mybrowsersettings.JPG

My data entry form.
timeenteredonform.JPG

SharePoint List View of dates entered.
timeshowninsplist.JPG

The flow test results of convert.
converttimezone.JPG

convertedtimeinflowresults.JPG

 

Got it to show me the correct time!
Now I need to get my west coast user to test it out and make sure it converts correctly.

Please note that Regional Settings apply to entire site. It is not a User level setting. 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
SmithEdwards
New Member

I have a similar issue. I want to keep the time exactly as entered. no conversion. I am running a vehicle request app. The headquarters is in Pacific time (where the SP system is set to Pacific Time) but i have people in all 4 time zones across the US. If someone in Ohio (Eastern Time) asks for a vehicle at 9am at the Cleveland airport, it is translated to 6am in the sharepoint list. I just want the time to stay exactly as entered. No conversion of any type. Any thoughts? 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,234)