Re: Get dates between dates
vb.net Code:
Dim time As Date = startDate
Do
myListBox.Items.Add(String.Format("{0:d} {0:HH:mm}", time))
time = time.AddMinutes(1)
Loop Until time > endDate
Note that that format creates a string containing the standard short date form for the system, followed by a space, followed by hours and minutes in 24 hour format.
Re: Get dates between dates
A quick Google search yielded the members of a DateTime object. It includes a method called AddMinutes.
Sounds like you can declare your start time, add 1 minute then add to the ListBox until it reaches the ending time. All that is required is a simple While loop.
Re: Get dates between dates
thank you so much... my brain always wants to make it complicated and here it is being the easiest!!!
Re: Get dates between dates
The critically important first step is to ask yourself what you would do if you had to do the same thing manually, with pen and paper. The algorithm should be the same and implementing a simple algorithm is generally simple.
Re: Get dates between dates
Quote:
Originally Posted by if_then_else
thank you so much... my brain always wants to make it complicated and here it is being the easiest!!!
No problem. Thanks for giving me a disapproval rating :(
heh
Re: Get dates between dates
Quote:
Originally Posted by kasracer
No problem. Thanks for giving me a disapproval rating :(
heh
That's the pain you suffer when you point people to where they could have answered their question for themselves. I've felt it many times.
Re: Get dates between dates
i gave everybody an approval? will do again, maybe i clicked wrong... my bad... i thought i gave everyone an approval rating as you all helped me in superman speed!!! i am a newbie to these forums so please forgive me... i tried to redo the rating but it wont allow...?
Re: Get dates between dates
Quote:
Originally Posted by if_then_else
i gave everybody an approval? will do again, maybe i clicked wrong... my bad... i thought i gave everyone an approval rating as you all helped me in superman speed!!! i am a newbie to these forums so please forgive me... i tried to redo the rating but it wont allow...?
What's done is done. :) Just keep kas in mind and give him a couple of positive ratings in the future to make up for it. You can only rate each person 1 in 10, so you'll have to rate 20 people in total to make good. I'm sure kas is worth it though. ;)
Re: Get dates between dates
Quote:
Originally Posted by if_then_else
i gave everybody an approval? will do again, maybe i clicked wrong... my bad... i thought i gave everyone an approval rating as you all helped me in superman speed!!! i am a newbie to these forums so please forgive me... i tried to redo the rating but it wont allow...?
No worries. I actually get quite a few disapproval ratings from new members when they tell me I helped them. I think the UI to give ratings is a little confusing to new members. Oh well.
Quote:
Originally Posted by jmcilhinney
What's done is done. :) Just keep kas in mind and give him a couple of positive ratings in the future to make up for it. You can only rate each person 1 in 10, so you'll have to rate 20 people in total to make good. I'm sure kas is worth it though. ;)
Heh, thanks. I'm worth all the ratings in the world! (which doesn't say much since ratings are worth $0, heh)
EDIT: According to this thread I'm just a dope and you gave me a positive rating. It just won't show up yet.