rocky050371
asked on
Adding minutes to a date
I have the following date which I need to add a number of minutes to determine the end date, how do I achieve this
_appointment.StartDate = CType(_appointment.StartDa te.ToShort DateString & " " & umeStartTime.Text, Date)
_appointment.StartDate = CType(_appointment.StartDa
So you need to add minutes to _appointment.StartDate AFTER you've done the CType? Or are you trying to add number of minutes in umeStartTime.Text to get your end time?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or, if you are trying to achieve this:
_appointment.StartDate = CType(_appointment.StartDa te.ToShort DateString & " " & umeStartTime.Text, Date)
_appointment.EndDate = CType(_appointment.StartDa te.ToShort DateString & " " & umeStartTime.Text, Date).AddMinutes(3)
_appointment.StartDate = CType(_appointment.StartDa
_appointment.EndDate = CType(_appointment.StartDa
Another older method of adding dates and times is the DateAdd method, here's an example of adding
3 minutes:
_appointment.StartDate = DateAdd(DateInterval.Minut e, 3, _
CType(_appointment.StartDa te.ToShort DateString & " " & umeStartTime.Text, Date))
MsgBox(_appointment.StartD ate.ToStri ng())
3 minutes:
_appointment.StartDate = DateAdd(DateInterval.Minut
CType(_appointment.StartDa
MsgBox(_appointment.StartD