Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sri Lanka Standard Time

 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4435
256
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The home page of this forum says
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.

Devaka
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Devaka,
We use JavaScript to figure out your time zone. Does your browser know Sri Lanka has changed time zones?

 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4435
256
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,

Finally I discovered the problem. It seems that problem is not only for my country. Well, let me show you.

The JavaScript at userLocalTime.js uses the logic below:




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:

 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for tracking this down; we'll put that in. I think Venezuela has a half-hour timezone as well, so you're not alone :-)
 
Henry Wong
author
Marshal
Pie
Posts: 21123
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...

Henry
 
Mike Simmons
Ranch Hand
Posts: 3080
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Considering India Standard Time is also at GMT+5:30, it's surprising no one here has noticed or mentioned this issue before.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike Simmons wrote:Considering India Standard Time is also at GMT+5:30, it's surprising no one here has noticed or mentioned this issue before.


Eh, give or take a half hour, what's the difference? You city slickers and your high-falutin' ways.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the Wiki: http://en.wikipedia.org/wiki/Time_zone
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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The release containing this fix is in production now. Thank you for bringing it up. Please try again.
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4435
256
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic