开发者

How to get Date and current time from the Date/Time column in SharePoint Custom list

I have column called "Date Submitted" as Date/time in one of the Custom list in sharepoint 2007. it always set to today's date and 12AM time instead of 开发者_Go百科that I want to display today's date with current time hh:mm:ss.

I tried creating calculated column TestDate and formula is : =TEXT(([Date Submitted]),"mm dd yyyy h:MM:SS")

result is 04 28 2010 0:00:00 I wanted to be 04/28/2010 10:50:34

Is it possible to achive this?

Thank you kanta


try to put =NOW() in the default value field in the column properties


In the definition of Date Submitted, is the Date and Time Format currently Date Only? If so, try changing it to Date & Time.


For something like this, I ended up creating a custom action which is called from a workflow.


A few ideas to get you started :-

  • Can you use the Created date instead - it will always be set to the exact time the record was created?

  • When entering a new item on the Calendar list it defaults to the current time - could you make your list from a modified Calendar list rather than the Custom list?

  • I've written a blog post about how you can use a JavaScript hack to set the default duration for a new calendar record - you could modify this to use with a Custom list and to set the field to the current time.

    Setting a default duration for new calendar events

  • You could write your own custom field type

    SharePoint 2007 Custom Date Time Field to default the time to the current time

    Codeplex - custom date time field


=TEXT([DateFiled Here],"mm/dd/YYYY hh:mm:ss ")


Here's how to do what you want:

=TEXT(Today,"mm/dd/YYYY")&" "&TEXT(Now(),"h:mm:ss")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜