How does your SharePoint site display a date?
The answer is… “it depends.” Create a new task and schedule it for January 3rd, 2012. Now display the task list and see how the date is displayed.
You would see the first if you had your SharePoint preferences (Regional Settings) set to a country where they enter dates as dd/mm/yyyy, such as France.
To play with the regional settings, click the Welcome menu at the top right of a SharePoint page and click My Settings. Then click My Regional Settings, uncheckmark “Always follow web settings” and pick a locale.
So what’s the problem?
In this example, if today’s date is February 15th 2012 and the Due Date is March 1st 2012 then Date.parse would show the task as past due for the French users and not past due for the United States users.
- Add a new column to your list and give it a name like DueDateYYYYMMDD
- Add a formula:
=YEAR([Due Date])&"/"&MONTH([Due Date])&"/"&DAY([Due Date])
- Save your changes
- Add this new column to your view
- Add some tasks with a due date and verify that both Due Date and DueDateYYYYMMDD have the same dates, just formatted differently
- Go to your Welcome menu, click My Settings, My Regional Settings and change your locale to France and confirm that while the Due Date column has changed, the DueDateYYYYMMDD is still the same
Make it do something useful