Forum Discussion
Create an 'Age/Days old' column in SharePoint List
- Feb 17, 2020
Hi Norman Young
The Number function of @now (& date fields) returns the value in milliseconds.
The value 86,400,000 represents 1 day in milliseconds
( 1000 x 60 x 60 x 24 )
Yes, by removing the /365 your result will be in days
For month result, you will have have to replace /365 with /30 (this will not be 100% accurate result due different number of days in a month)
testio2 you cannot do this using a calculated column, as it stores static information.
If you are using the modern experience in SharePoint Online, check out column formatting and view formatting. You'll need to use @now, which resolves to the current date/time.
Here are two references to get you started:
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#apply-formatting-based-on-date-ranges
Christophe Humbert actually NOW() doesn't resolve the issue of auto-updating calculated columns. It doesn't matter if you write your calculated columns with NOW() or TODAY(), the problem exists that the data becomes incorrect after one day unless you edit the item.
- Rob EllisSep 24, 2019Bronze ContributorWhat Christophe means is to use the @now in either column or view formatting, as per the linked references.
As an example, you could apply formatting to the 'created' column, so that rather than displaying the actual value, it displays the age of the item. That display would be updated at the point of loading the page / view - so would not rely on someone editing the items.