Javascript wierd Date issue

Power Platform Resource 1 Reputation point
2020-08-19T15:37:20.727+00:00

Hi,

I have a SharePoint list with delivery date column. I have created a table to display current week and next week delivery items using java script. Everything works fine but for couple of team members Thursday delivery items are displaying in Wednesday cell and Friday items in Thursday cell.

I am not sure why it is happening. Can anyone help me out to resolve this issue? Any help would be greatly appreciated.

Thank you.

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,619 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jerryzy 10,571 Reputation points
    2020-08-20T06:19:46.91+00:00

    Hi @Power Platform Resource ,

    I assume this issue for wrong date display should be related to the Time Zone settings, as SharePoint stores the Date in UTC Time Zone, so if the real value maybe less or more a day from the right value.

    Here is a blog explain the reason for the issue:

    sharepoint-time-is-not-your-time-is-not-their-time

    The solution is using Moment.js to covert UTC to Local Time based on Time Zone, please check out the thread below:

    How to convert SharePoint Date-Only field from UTC to local time zone


    If the response is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.