Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have tried using =TEXT(Today,"mm-dd-yyyy hh:mm:ss") but that only returns the 5/5/55 00:00:00, it won't give the time. How do I get both the date and time with a calculated formula?

share|improve this question
1  
Why don't you edit your question and put down what you're trying to acheive with this, e.g. "Display red text when a task is overdue". Today in calc columns doesn't work but there are other ways to do things - so tell us what you're trying to do. –  Ryan Feb 24 '12 at 8:19
    
I think he did ask a good specific question. " How do I get both the date and time with a calculated formula?" The issue is that time is always 00:00:00.000. –  Joe Johnston May 2 '13 at 22:11

3 Answers 3

up vote 8 down vote accepted

Unfortunately if you are trying to have this always show the current date and time, this won't work since Calculated Columns are not recalculated on viewing, but only on creation and modification. See this article: http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/

However, if you are just trying to extract the time when calculated then you could switch your formula to: =TEXT([Modified],"mm-dd-yyyy hh:mm:ss")

share|improve this answer
    
I have tried this, but it seems the [Modified] part of the formula is not working and every time I try to save the changes to the column I get a runtime error, however [Today] will work. Does the column with this formula have to be set to a certain type or will Single line of text work? –  Meyer Denney Feb 23 '12 at 19:37
    
[Today] doesn't work, never has, even with the fake today column tricks. You said so in your question - now you're saying it does. Want to clarify? –  Ryan Feb 24 '12 at 8:18
    
The =TEXT([Modified],"mm-dd-yyyy hh:mm:ss") formula doesn't work if you switch a regular text field column to start using a calculated formula. For example we had a text field that got used for a bit and now the end-user wants it to generate a random number. My first instinct was to flip the radio button to "Default Value: Calculated Value" and put that formula in. This does not work because the Modified column hasn't actually been populated yet. Is there a way to get an accurate timestamp without being forced to do so within a calculated formula column specifically? –  MAllen22842 Feb 28 '13 at 17:47

Sure you can, here are the methods http://office.microsoft.com/en-us/windows-sharepoint-services-help/CH010103260.aspx

share|improve this answer
1  
Yes there are formula to extract date/time from a date field BUT [Today] does not work in calculated columns. –  Ryan Feb 24 '12 at 8:17
    
That is true, you have to build it for yourself –  Eric Herlitz Feb 24 '12 at 8:21

I have a list with tasks that all have to be finished within a certain deadline. I wanted the list to show me which deadlines were getting closer or were exceeded. After a long search on the internet I found there was no satisfying solution to make a column using the current date. However, I found out that when you modify the view of a list, you can put [today] in the filter section. This allows you to base the view of your list on the current date. This date will automatically be kept current. (I have a Dutch version of SharePoint, so I hope I guessed the used terms right ;) ).

I made 3 different views of the same list on one page. For all views I edited the list view and checked the box which says only show items if under the tab filter ;

View 1, named: Deadline exceeded:

'Only show if'

'deadline' column

'smaller than'

[today]

View 2, named: Deadline < 30 days:

'Only show if'

'deadline' column

'bigger than'

[Today]

and

'Only show if'

'deadline' column

'smaller than'

[Today]+30

View 3, named: Deadline > 30 days:

'Only show if'

'deadline' column

'bigger than'

[Today]+30

Additionally I placed the different webparts in colored tables (red, orange and green).In this way it’s very easy for me to prioritize the different tasks in my task list. .

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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