stumbleupon/opentsdb — pull request #122 by oozie (2012-08-10 23:52:49+00:00)
Title: Fix for 30d integer overflow in DateTimeBox.

When selecting the 30d in TSD's DateTimeBox in the UI, the date shifts by over 500 years instead of the expected 30 days. This is due to an integer overflow in the following piece of code:

d.setTime(d.getTime() + seconds * 1000);

where `seconds` is declared as an integer. 30 days in seconds multiplied by 1k equals to 2,592,000,000 seconds. The integer range ends at 2,147,483,647, hence the overflow.

Changing 1000 to 1000L returns long as opposed to integer product and fixes the issue.