I am in the midst of updating a clients website, only I am having some trouble using their existing code.
They have a fixed schedule which displays what times the presenters are "on-air"....
I have created some timezone offset's for basic countries and I would like it to take the offset off the set time, which is in the MySQL database.
So basically the time is 2100 - 0000 GMT and the user selects Brazil as their timezone, so it takes -0300 off the time. But the trouble I am having is the result is turning out in negative numbers, so instead of it showing 1800 - 2100, it shows 1800 - -300.
Same thing if the time is say 2100 - 2200 and the user selects USA which adds +0800 onto the time, it ends up as 2900 - 3000.
How can I get PHP to only work within the numbers 0000 - 2359 and have no negative numbers whatsoever?
I was looking into scrapping what they have and using php time()/date(), but that is a hell of alot of work as they have other places relying on the data in the database and parsing it in different ways.
So, any ideas anyone?
Many thanks in advance