All times above are in your local time zone & format.
But the forum doesn't show the correct time for me, as I'm from Sri Lanka. We are currently using GMT+05:30 Time Zone in our country, since year 2006. But it seems that JavaRanch is using GMT+06:00 Time Zone for Sri Lanka, as we did before 2006. You can make it confirmed here, and please feel kind to correct this as soon as possible.
Finally I discovered the problem. It seems that problem is not only for my country. Well, let me show you.
The problem is with statement below:
The above statements supposes to change the hour of the 'date', due to the local time zone. If my local time zone is GMT+5:30, the variable userOffsetFromGmt contains floating point (double) number, i.e. -5.5. Therefore, the expression passes a floating point value for the date.setHours method.
But remember that the method date.setHours accepts a 'numerical' value for it's first paremeter. In that case, it takes the numerical value to the account, by removing the decimal points. Oh! 30 minutes gonna lost!
As a suggestion, please replace that statement as below:
I think Venezuela has a half-hour timezone as well, so you're not alone :-)
Another is Newfoundland in Canada -- home of the really cute Newfie. I always set my watch to the local time, so I was fine with it. My wife always keeps her watch in our home timezone, so it really annoyed her, when we were there...
Newfoundland, India, Iran, Afghanistan, Venezuela, Burma, the Marquesas, as well as parts of Australia use half-hour deviations from standard time, and some nations, such as Nepal, and some provinces, such as the Chatham Islands, use quarter-hour deviations. Some countries, most notably China, use a single time zone even though the extent of their territory far exceeds 15° of longitude.
Thanks for sharing. It's nice when bug reports come with the fix! I did know that there were 30 min offsets, but I wasn't thinking about it when I wrote the original code nor modifying it for JForum. And I didn't know a big country like India used a half hour offset. Always learning new things around these parts.