How Date-Time Columns Work In SharePoint

Introduction

 
In this article, we will learn how SharePoint displays date-time values in lists or libraries.
 
Many times, we face issues like while checking the value of the date-time column it displays different date-time for different users, and when we try to get the value of the date-time field using Rest API, it will display a different date-time.
 
So, in this article, we will learn why the value of the date-time column is different in different places.
  
The date-time that SharePoint shows doesn't depend on your system’s time zone.
 
SharePoint considers the below time zones to show DateTime:
  1. Time zone selected by current logged in user for his/her profile.
  2. Time zone selected in Regional settings of site collection settings.

How to select the time zone in my profile

 
Step 1
 
Click on the user profile icon from the top right corner and click on the My Office profile link, as shown in the below screenshot.
 
How Date Time Columns Works In SharePoint
 
Step 2
 
On clicking, it will redirect to my user profile delve.
 
How Date Time Columns Works In SharePoint How Date Time Columns Works In SharePoint
 
Step 3
 
Now click on the Update profile button.
 
Step 4
 
On clicking, it will open the page where you can update the value of different user profile properties of your profile.
 
How Date Time Columns Works In SharePoint
 
Step 5
 
Now click on the add more information link, as shown in the below screenshot.
 
How Date Time Columns Works In SharePoint
 
Step 6
 
On clicking, it will redirect to the page where you can update all the user profile properties. Now click on three dots and select the Language and Region option as shown in the below screenshot.
 
How Date Time Columns Works In SharePoint
 
Step 7
 
Here you can see by default Always use regional settings defined by site administrators option is selected and the dropdown of time zone selection is disabled.
How Date Time Columns Works In SharePoint
 
Step 8
 
Now select the radio button of Always use my personal settings. On selecting this radio button, a dropdown of the time zone section will be enabled and you can select the time zone for your user profile. 
How Date Time Columns Works In SharePoint
 
Step 9
 
Now go to the bottom of the page and click on the Save all and close button.
How Date Time Columns Works In SharePoint
 
Step 10
 
On clicking, it will show an alert message with information that changes to the profile will take some time to effect.
 
How Date Time Columns Works In SharePoint
 

How to select the time zone for a site collection

 
Step 1
 
Click on the Settings icon from the top right corner and click on Site information.
 
How Date Time Columns Works In SharePoint
 
Step 2
 
On clicking, it will open another panel. Now click on View all site settings.
 
How Date Time Columns Works In SharePoint
 
Step 3
 
On clicking, it will redirect to the site settings page. Now click on Regional settings in the Site Administration section.
 
How Date Time Columns Works In SharePoint
 
Step 4
 
On clicking, it will redirect to the page regional settings page. From this page, we can select the time zone and we can also select other region related settings. After selecting the time zone, click on the OK button.
 
How Date Time Columns Works In SharePoint

How SharePoint shows date time column’s values

 
Now we will understand how SharePoint shows the value of the date-time column.
  • If the user has selected a time zone in his/her profile, then SharePoint will display the date-time in that particular time zone.
  • If the user has not selected a time zone in his/her profile, then SharePoint will display the date-time in the time zone of the selected time zone in the regional settings of site settings.
Let’s understand this with an example:
  • I have created one list and add a date-time column to the list. In the site settings of this site collection, I have selected (UTC-08:00) Pacific Time (US and Canada) time zone.
  • We will check with two different users, which has a different regional setting in the user profile.
  • User 1: This user has selected (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi time zone in his user profile.
  • User 2: This user has not selected any time zone in his user profile.
Now I am creating one item in the list using User 1 with the below values:
 
How Date Time Columns Works In SharePoint
 
Now for User 1, it will display the date-time value the same as the selected date time while creating the item. So, for User 1 it will display as shown below:
 
How Date Time Columns Works In SharePoint
 
As the item created by User 1 and time zone selected by User 1 is selected (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi, so SharePoint will display date time selected (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi time zone.
 
But for User 2, it will display a different date time as User 2 has not selected a time zone in his user profile, it will display the date-time value as per the time zone selected in regional settings of the site collection. It means it will display date time in (UTC-08:00) Pacific Time (US and Canada) time zone.
 
How Date Time Columns Works In SharePoint
 
So, if user 2 has selected any time zone in his user profile, then SharePoint will display the date-time in that particular time zone. But here User 2 has not selected any time zone in his user profile, so it is displaying the date-time value in the time zone of regional settings of site settings.
 

Summary

 
I hope this article is helpful for you to understand how SharePoint shows the date-time column's value based on the regional settings of the site and user profile.