English 中文(简体)
我想计算一下Lotusscript的2个日期差(IBM Lotus Notes 8.5)。
原标题:I want to calculate 2 dates difference in Lotusscript (IBM Lotus Notes 8.5)

I want to calculate two dates difference in Lotusscript. e.g. (10/18/2011 - 08/18/2011) = 71 days

问题回答

来自Lotus设计师的帮助:

时间推移方法, 得出一个日期与另一个日期之间的差数。

notesDateTime.TimeDifference( notesDateTime )
d1 = DateNumber(2011,10,18)
d2 = DateNumber(2011,8,18)

d1 = d1 - d2
MessageBox d1

在这里,你可以 but子,看看它如何运作:

Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace   
Dim uidoc As NotesUIDocument        
Dim doc As NotesDocument            
Dim startDT As New NotesDateTime("")
Dim endDT As New NotesDateTime("")
Dim diff As Long

Set uidoc = workspace.CurrentDocument   
Set doc = uidoc.Document        

Set startDT = doc.getFirstItem("StartDate").dateTimeValue
Call startDT.SetAnyTime 
Set endDT = doc.GetFirstItem("ReturnDate").dateTimeValue
Call endDT.SetAnyTime   
diff = startDT.TimeDifference(endDT)    
Msgbox Cstr(diff)   
End Sub

Here is a table I keep to help me get my brain around the numbers:

<table>
  <tr>
    <th>startDT</th>
    <th>endDT</th>
    <th>Result</th>
  </tr>
  <tr>
    <td>June</td>
    <td>March</td>
    <td>Positive</td>
  </tr>
  <tr>
    <td>June</td>
    <td>October</td>
    <td>Negative</td>
  </tr>
</table>

如果3月份为3月份,你必须补充(即邮政),到6月份,即6月份。 如果6月份还剩下6个,从10月份开始,你必须退席(即消极)。

这在很大程度上取决于你重新储存日期。 日期的方案拟订是Lotusscript的一大痛苦。

If you re using NotesDateTime objects, then Jasper s solution is the best, although I get confused as to what is substracted from what.

简单的做法是将时日值转换为单项和子体。 ci点之前的部分时间是几天,之后的部分时间是小时......





相关问题
Where are the javadocs for Lotus Notes.jar?

I need to use Lotus Notes/Domino as a data source from a Java application. The documentation at IBM says that the Notes.jar contains everything I will need, but where are the javadocs?

Is Interop.Domino dll thread safe?

I am using Interop.Domino dll version 1.2 in c# application, and using multithreading to access multiple NSF file at same time by creating new session for each thread created (Max 5 threads at a time)....

C#和Lotus Notes附录一

我正在使用C#,并需要附上一张空白(shortcut/link)档案和电子邮件给一个彩票账户。 问题是一对一幅通用形象的不实之词,没有像......那样显示双fold。

How to maintain Lotus Notes Version ? C#

I made one product which is retrieving attachment from mails and saving it on particular folder. But problem i am facing is it is not working in 8.0 version. I did development on Lotus Notes 8.5 ...

How to Edit NSF file using c#?

I want to programaticaly change some values to NSF item and then want to save it.(i.e to edit NSF File and then save the editions) for example: I want to set Sender name of all mails to "preeti@abc....

热门标签