Link to home
Start Free TrialLog in
Avatar of Dale Massicotte
Dale MassicotteFlag for United States of America

asked on

visual studio dropdownlist calculate time values

NOW
5:00 PM
5:15 PM
5:30 PM
5:45 PM
6:00 PM
etc

I want this to stop at 11:45 PM

here is existing code (seems i need some kind of do until loop perhaps?

        ddlFullTime.Items.Add(New System.Web.UI.WebControls.ListItem(dtMod.ToShortTimeString, dtMod.ToShortTimeString))
        dtMod = dtMod.AddMinutes(15)
        ddlFullTime.Items.Add(New System.Web.UI.WebControls.ListItem(dtMod.ToShortTimeString, dtMod.ToShortTimeString))
        dtMod = dtMod.AddMinutes(15)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dale Massicotte

ASKER

Why reinvent the wheel when you have guru_sami?

My brain is too slow and my loop sucked

Thanks for the code to sort of parse the date and time out.

I was almost there!
A+++++++++++++++++
Thanks. Glad to help.