0

How can I create a column in SharePoint 2013 which represent the current date. For example today is 02/09/2016 tomorrow should be 02/10/2016, 02/10/2016... and so on each day the date must be changed.

I was wondering if someone could tell me, thanks.

5
  • 1
    Should the column always display the current date? Or when the item is saved it should save the current date, so that item created on different dates have different values?
    – Naveen
    Feb 9, 2016 at 13:29
  • What is the requirement behind this ?
    – JayHell
    Feb 9, 2016 at 13:29
  • the date should be changed everyday. It have to represent its current date Feb 9, 2016 at 13:36
  • 1
    My question was more like : what is the business requirement ? Do you need it for display purposes, etc. ? You will have hundreds of items in your list, all with a column with the current date, from a user point of view, I don't see the value there.
    – JayHell
    Feb 9, 2016 at 13:43
  • @JayHell thanks but i solved my problem thank you so much. Feb 9, 2016 at 13:47

3 Answers 3

2

Create One Calculated type column and set data return formula type to Number and apply this formula:

="<img src='/_layouts/images/blank.gif' onload=""{"&" var day=new Date();"&" this.parentNode.innerHTML= day ;"&"}"">"

You will current date and time.

UPDATE

For only Date try below formula:

="<img src='/_layouts/images/blank.gif' onload=""{"&" var day=new Date();"&" var n = day.format('dd/MM/yyyy');"&" this.parentNode.innerHTML= n ;"&"}"">"

6
  • Does this formula updates the column each day? Feb 9, 2016 at 13:39
  • and what if you export to Excel ? get the value with CSOM or SSOM ?
    – JayHell
    Feb 9, 2016 at 13:44
  • Thanks man but how can i display only shortdate like 02/09/2016? Feb 9, 2016 at 13:46
  • @JayHell thanks for your responsibility but in my case i never need to export to excel Feb 9, 2016 at 14:04
  • There is more Today calculations and colors fun here Feb 9, 2016 at 15:30
0

You create the column as you'd like, and set the default value to Todays Date. enter image description here

2
  • I thought of the same approach. But the OP wants the date to be changed everyday in the column. :)
    – Asad Refai
    Feb 9, 2016 at 13:31
  • Yes but I.E today date is 02/09/2016 but tomorrow the date still is 02/09/2016. In my case date must be updated everyday but thanks Feb 9, 2016 at 13:38
0

You will have to add a column to your list view, then choose Type as Date and Time and put the default value as Today's Date. You create a new column under views in Library settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.