日付の計算

Sub Click(Source As Button)
	Dim DateA As NotesDateTime
	Dim DateB As NotesDateTime
	Dim str1  As String
	Dim diff  As Double
	
     '最初の日付のセット
	str1 = Inputbox( "最初の日付を入力してください。", "日付の計算", Today )
	Set DateA = New NotesDateTime( str1 )
	
     '二番目の日付のセット
	str1 = Inputbox( "二番目の日付を入力してください。", "日付の計算", Today )
	Set DateB = New NotesDateTime( str1 )
	
     '日付の計算(結果は「秒」で出力される)
	diff = DateA.TimeDifference( DateB )
	Msgbox _
	"2つの日付の差は"                & Chr$(10) & _
	"秒: " & Cstr( diff )           & Chr$(10) & _
	"分: " & Cstr( diff / 60 )      & Chr$(10) & _
	"時: " & Cstr( diff / 60 / 60 ) & Chr$(10) & _
	"日: " & Cstr( diff / 60 / 60 / 24 ), _
	0 + 64, "日付の計算"
End Sub





2つの日付の差分を計算して画面に表示します。

LotusScript
guylocke
December 28, 2015 at 10:17 AM
Rating
0





No comments yetLogin first to comment...