list 如何从 SharePoint 自定义列表的日期/时间列中获取日期和当前时间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2731079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 01:29:44  来源:igfitidea点击:

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

sharepointlist

提问by Kanta

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 that I want to display today's date with current time hh:mm:ss.

我在 sharepoint 2007 的自定义列表之一中有名为“提交日期”的列作为日期/时间。它总是设置为今天的日期和上午 12 点时间,而不是我想用当前时间 hh:mm:ss 显示今天的日期。

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

我尝试创建计算列 TestDate 和公式是: =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

结果是 04 28 2010 0:00:00 我想成为 04/28/2010 10:50:34

Is it possible to achive this?

有可能实现这一目标吗?

Thank you kanta

谢谢坎塔

回答by jps

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

尝试将 =NOW() 放在列属性的默认值字段中

回答by Rich Bennema

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

在Date Submitted 的定义中,Date and Time Format 当前是否为Date Only?如果是这样,请尝试将其更改为日期和时间。

回答by Daniel Dolz

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

对于这样的事情,我最终创建了一个从工作流调用的自定义操作。

回答by Ryan

A few ideas to get you started :-

一些帮助您入门的想法:-

回答by Bobby

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

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

回答by urbanaut

Here's how to do what you want:

以下是如何做你想做的事:

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