Correction in 'gmt_to_local', fails near edge case

Try to pass a date near the edge case of a date-time for a timezone where daylight saving is observed. The previous code would return the wrong result. 
For example, 10th March, 2013 01:30:00 AM in UM5 timezone is stored as 10th March, 2013 06:30:00 AM in GMT time in database.
But since the daylight saving is turned ON at 10th March, 2013 02:00:00 AM, when the 'gmt_to_local' function is used to turn the 'gmt' time to local UM5 time, it returns 10th March, 2013 00:30:00 AM instead of the correct value 10th March, 2013 01:30:00 AM.
The given patch solves the issue, without affecting the functionality anywhere.
The original code works well for most of the time, but fails near the edge case, as explained above.