04-08-2009 02:59 PM
Ok what I am trying to do is update my date with three string combo boxes. I am using a time Stamp to two string indecators for my current date and now the user has the option of adding the expiration date they can add months to the current date or days and even hours
how would I do this?
here is my current code:
Solved! Go to Solution.
04-08-2009 03:35 PM - edited 04-08-2009 03:38 PM
04-08-2009 03:59 PM - edited 04-08-2009 03:59 PM
Something like this should work. No need to worry about the number of days in each month, just let the computer handle it. You need to copy the hours through in the for loop to avoid losing or gaining an hour when daylight savings time starts and ends.
04-08-2009 04:03 PM - edited 04-08-2009 04:04 PM
04-09-2009 09:12 AM - edited 04-09-2009 09:13 AM
Jmcbee - I don't think your approach handles year boundaries well (if I put in more months than the end of the year, I get a date in 1903). On the other hand it seems to work fine with adding 366 days. The for loop in my approach is unecessary, the right way to handle the year problem is probably this:
04-09-2009 09:16 AM