Fixed timezone offset on SQL queries

The generatesnapshot method was returning the wrong date range because
the timezones in the sql queries were being automatically adjusted to
account for the timezone by node.  I added a method to offset this.