peterdevadoss
asked on
datetime manupulation
I wanna know the difference between two time variables:
1. char type as fetch from the datetime field from a table as follows:
select top 1 CONVERT(CHAR(5), myTime, 114) as newTime from table1
ex:10:30 (10 hour 30 min am)
2. time from system date as follows:
system.now.hour = 11
system.now.minutes = 40
solution:
giventime - currenttime
ex: 10.30 - 11.40
note: difference in minutes
I want to know the different between these two variables.
Anyone who can suggest very simple code for this solution?
1. char type as fetch from the datetime field from a table as follows:
select top 1 CONVERT(CHAR(5), myTime, 114) as newTime from table1
ex:10:30 (10 hour 30 min am)
2. time from system date as follows:
system.now.hour = 11
system.now.minutes = 40
solution:
giventime - currenttime
ex: 10.30 - 11.40
note: difference in minutes
I want to know the different between these two variables.
Anyone who can suggest very simple code for this solution?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim a1 As String = Now.Subtract(a).Hours.ToSt
Dim a2 As String = Now.Subtract(a).Minutes.To
Dim a3 As String = Now.Subtract(a).Seconds.To