Example:
DimDAsDate=DateValue(GetSetting("cp","api","searchDate","1999-01-01 01:01:01"))+TimeValue(GetSetting("cp","api","searchDate","1999-01-01 01:01:01"))
IfD>NowThen
DimMinutesAsLong=DateDiff(DateInterval.Minute, Now, D)
MsgBox(Minutes&"분 후에 검색해 주세요.")
Return
EndIf
아래 링크 참고:
DateDiff지정 된 날짜와 오늘 사이의 일 수:
Dimdate2EnteredAsString=InputBox("Enter a date")
Try
Dimdate2AsDate=Date.Parse(date2Entered)
Dimdate1AsDate=Now
' Determine the number of days between the two dates.
DimdaysAsLong=DateDiff(DateInterval.Day, date1, date2)
' This statement has a string interval argument, and
' is equivalent to the above statement.
'Dim days As Long = DateDiff("d", date1, date2)
MessageBox.Show("Days from today: "&days.ToString)
Catch exAsException
MessageBox.Show("Invalid Date: "&ex.Message)
EndTry
Visual Basic이 보이는 그림책, 성안당
14,400원 (포스팅일기준) |

댓글