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.

Nderon Hyseni
  • 1,793
  • 6
  • 35
  • 63
  • 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 09 '16 at 13:29
  • What is the requirement behind this ? – JayHell Feb 09 '16 at 13:29
  • the date should be changed everyday. It have to represent its current date – Nderon Hyseni Feb 09 '16 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 09 '16 at 13:43
  • @JayHell thanks but i solved my problem thank you so much. – Nderon Hyseni Feb 09 '16 at 13:47

3 Answers3

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 ;"&"}"">"

Dikesh Gandhi
  • 6,803
  • 4
  • 30
  • 55
0

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

Eric Alexander
  • 43,293
  • 10
  • 53
  • 93
  • I thought of the same approach. But the OP wants the date to be changed everyday in the column. :) – Asad Refai Feb 09 '16 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 – Nderon Hyseni Feb 09 '16 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.

Line T
  • 11
  • 4