Sharepoint Designer - 有没有办法计算工作流程中的日期差异?
也许我只是疯了......所以,使用 SPD,我可以将任何时间单位添加到日期并将其放入变量中,但我似乎找不到任何可以让我计算两个日期之间的差异的东西。 “进行计算”只允许我从数值中进行选择。我在这里错过了什么吗?看起来应该是显而易见的事情。
Maybe I'm just crazy... So, with SPD I can add any time unit to a date and put that into a variable, but I can't seem to find anything that will let me calculate the difference between two dates. "Do Calculation" only lets me pick from numeric values. Am I missing something here? Seems like something which should be obvious.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(4)
从 SharePoint 2013 开始,您可以使用“查找日期之间的间隔”操作。
查找日期之间的间隔 计算两个日期之间的时间间隔(以分钟、小时或天为单位)并将输出存储在变量中。
https://msdn.microsoft.com/en-us/library/office /jj164026.aspx
字符串和日期操作以及计算是 SharePoint Designer 工作流中的一个难题。 Colin 提到的链接很好,但您可能还需要考虑将 C# 或 vb.net 代码直接嵌入到 SharePoint Designer 工作流中(无需 Visual Studio)。
我编写了一个允许您执行此操作的组件,并在以下 URL 上发布了相关博客:
http://www.muhimbi.com/blog/2009/12/embed-c-or-vb-code-directly-in.html
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
日期比较不能“开箱即用”,但有一些解决方法。
也许这篇文章: 如何在 SharePoint Designer 工作流中执行日期计算并构建动态字符串提供了答案?
这里有一些更多相关信息:修改 SharePoint Designer 工作流中的日期格式< /a>
Date comparison is not available "out of the box", but there are some workarounds.
Maybe this article: How to perform date calculations and construct dynamic strings in a SharePoint Designer workflow provides the answer?
Some more related information here: Modifying Date Formats in SharePoint Designer Workflows