Advertisements

Using today’s date and/or current time in calculated columns and list view filters

I previously shared how to create a “Today” column in SharePoint that would always be up-to-date even if list items weren’t modified. These were no-code solutions that utilized either SharePoint Designer or Microsoft Flow. You can, however, use Today’s date/time to create views and calculated columns without workflow or script or the need to create another column.

“Today” in list and library views

In views, you’ll need to set filters using

[Today]

viewtoday

You could also create more complicated filters such as:

  • Incomplete projects: DueDate <= [Today] AND Completed=No
  • Projects beginning in a week or more: StartDate >= ([Today]+7)
  • Last year on this day: Created = [Today]-365

Calculated columns with today and/or current time

In calculated columns, you’ll need to use

Today()

or

Now()

as the value for today’s date or today’s date and time.

The difference is Now() uses date and time, so you’ll get down-to-the-minute values (i.e. hours since reported). Today is just date best used for data with no times involved (i.e. days since hire date). The following is a side-by-side comparison using the same “Created” date subtracted from Today() and Now(). You’ll notice the value using Now() is a little higher because it includes the hours already passed today whereas Today() hasn’t changed since midnight.

today vs now

Note: Views using “Today” will always show correctly. The calculated column methods above, however, are a snapshot of today or the current time. They will not update automatically or regularly; just when a list item is modified.

If you need a “live” always-updated value regardless of items being modified, you’ll need to create a separate “Today” column using Microsoft Flow or SharePoint Designer:

This post also includes ideas for calculations using today’s date.

Advertisements

1 Comments

  1. Pingback: 5 ways you can use SharePoint list and library view settings to improve the user experience – SHAREPOINT LIBRARIAN

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: