Ivan Rivera
Ivan Rivera

Reputation: 385

Is it possible to get the current date in sharepoint 2010?

I want to store the current date in a column's view i have and then compare it with a date a user has saved.

Is it possible to get the current date in sharepoint 2010?

Upvotes: 4

Views: 26121

Answers (4)

CodeHawk
CodeHawk

Reputation: 13

Did you know: Calculated Fields DO accept =Today() then select the datea type as Date.
Tested and working: You can use Today() in the DATEDIF function. Then select the formula output data type as expected, for example you can use number if the expected output is "D" for days. http://office.microsoft.com/en-us/help/datedif-function-HA001160981.aspx

Upvotes: 1

Stu Pegg
Stu Pegg

Reputation: 1317

I wrote an article on our company blog that outlines the various methods of using [Today] in this context, as well as a little background on why [Today] isn't available in calculated columns:

Warning: this also contains recommendations for our own product

How to use [Today] in a sharepoint list

Here are the main methods covered:

  • JavaScript: Use a Content Editor Web Part
  • Designer: Create a custom view in SharePoint Designer
  • Code: Make your own custom field type from scratch
  • SharePoint Highlighter: Our own solution to the problem

Upvotes: 2

Bill
Bill

Reputation: 51

You can use [Today] as a filter in views. For example, for a task list you could filter overdue tasks by setting a filter "DueDate < [Today]".

Upvotes: 3

Christophe
Christophe

Reputation: 28134

You cannot store the current date. What you can do is use the current date to filter the results of a query.

Upvotes: 0

Related Questions