上次保存在数据库中的日期是:6/13/2012 12:27:30 PM
在我的 DateTime 现在是:6/13/2012 01:27:57 AM
但是,当我执行此功能时,它总是说:“日期已手动修改,请设置为有效日期时间”
但是,DateTime Now 不小于我数据库中的日期。怎么了?
这是代码,请纠正它,
Private lastdate As DateTime
Private Sub GetDBdate()
...
Dim ss As String
Dim sc As New SQLiteCommand
ss = "select dtime from dincome order by dtime desc limit 1"
sc = New SQLiteCommand(ss, mycon)
lastdate = CDate(sc.ExecuteScalar)
End Sub
Private Function CheckValidDate() As Boolean
Dim dtnow As DateTime = DateTime.Now
If dtnow < lastdate Then
Return False
End If
Return True
End Function
Private Sub Button_Click
If Not CheckValidDate() Then
label1.Text = "Date has been manually modified, Please Set to Valid DateTime"
Exit Sub
End If
...
...
Exit Sub