Yeuck!
Quite frankly, I don't think this is not the right way of approaching this problem.
Personally, I would do the following:
- Convert the date/time to a unix timestamp (which is the normal PHP way)
- Add the appropriate number of hours / minutes etc to it
- Convert it back into a date
This will work correctly in every case, and be a lot more concise and maintainable.
The only problem is that PHP does not have a standard function for converting a string into a date - you'll have to write that yourself.
But any application which handles dates is going to need one of those anyway - write a single function and reuse it throughout, making sure it will parse dates in the format that you expect from your country's conventions (and reject invalid ones).
Mark