I am trying to return the difference in minutes from a starttime and stoptime
using the datediff function in a Web Project with VB.Net
With:
StartTime = 2/10/2006 8:46:03 PM
EndTime = 2/10/2006 8:48:10 PM
I am getting a return value of 1054586688 in the diff variable
I tryed this same code in a Windows.Net Project and I get a return of 2 as I
would expect.
Can someone tell me what I need to do in a Web Project to make this simple
code work?
Code from Web Project
=============== ===
Partial Class _Default
Inherits System.Web.UI.P age
Dim StartTime As Date
Protected Sub btnStartTime_Cl ick(ByVal sender As Object, ByVal e As
System.EventArg s) Handles btnStartTime.Cl ick
StartTime = Now
lblStartTime.Te xt = StartTime
End Sub
Protected Sub btnStopTime_Cli ck(ByVal sender As Object, ByVal e As
System.EventArg s) Handles btnStopTime.Cli ck
Dim EndTime As Date = Now
lblStopTime.Tex t = EndTime
Dim Diff As Integer = DateDiff(DateIn terval.Minute, StartTime,
EndTime)
txtTime.Text = Diff
End Sub
End Class
using the datediff function in a Web Project with VB.Net
With:
StartTime = 2/10/2006 8:46:03 PM
EndTime = 2/10/2006 8:48:10 PM
I am getting a return value of 1054586688 in the diff variable
I tryed this same code in a Windows.Net Project and I get a return of 2 as I
would expect.
Can someone tell me what I need to do in a Web Project to make this simple
code work?
Code from Web Project
=============== ===
Partial Class _Default
Inherits System.Web.UI.P age
Dim StartTime As Date
Protected Sub btnStartTime_Cl ick(ByVal sender As Object, ByVal e As
System.EventArg s) Handles btnStartTime.Cl ick
StartTime = Now
lblStartTime.Te xt = StartTime
End Sub
Protected Sub btnStopTime_Cli ck(ByVal sender As Object, ByVal e As
System.EventArg s) Handles btnStopTime.Cli ck
Dim EndTime As Date = Now
lblStopTime.Tex t = EndTime
Dim Diff As Integer = DateDiff(DateIn terval.Minute, StartTime,
EndTime)
txtTime.Text = Diff
End Sub
End Class
Comment