[MK]: I believe you are correct, however, how do I fix this my problem? Well, the code is doing what you told it to do. I don't know enough about what you're
trying to do here. Two possible simple fixes are:
1) Since the DB is apparently storing the date as midnight EDT, use a Calendar that's set to the EDT timezone. Which is apparently what you'll get by default anyway. Trying to use GMT-7 seems to be causing problems; why are you doing that? Try using the default time zone EDT and setting the hour of the day to 9 PM, which is 6 PM in PDT or GMT-7.
2) Just add 1 day to the Calendar result.
For both of these, you will probably want to
test the results carefully. Does the DB ever have startDateFromDB which is set to a different time of day, or is it always midnight EDT (or EST)? Does the code work both during daylight saving time and in winter? You may need to specify some time zones differently to get it to work.
If those don't work for you, please describe exactly what you're trying to do here.
[MK]: From my understanding time is stored as milliseconds since 1970, so when I pull it out its relative to GMT time, then formatted to whatever local/timezone I am in. That's true, although the GMT part isn't relevant here, I think - it's just an internal detail. Your problem is the mismatch between EDT and GMT-7.
[MK]: With that said, I'm assuming that the set function will format the HOUR_OF_DAY relative to the timezone that the Calendar instance is set to. Yes.
[MK]: However it seems java is setting the time relative to the GMT time. Is this correct? It's true, but I really don't think it's relevant here. Midnight on Aug 14 EDT is the same time as 9 PM Aug 13 in GMT-7, or 0400 Aug 14 GMT. Whether you see it as the 13th or 14th depends on what time zone you use to interpret it. E.g. using a DateFormat set to a particular TimeZone. Or using a Calendar as you are here. You've told the JVM to use GMT-7, so it sees the date as the 13th.
[MK]: Is it just me or Java Calendars/Date seem kinda weak. Oh, they're hard to use; it's not just you. Partly that's because human timekeeping is more complex than many people realize, and partly that's because they're badly designed. Especially Calendar. But I think the issues you're having are not because of the design problems, but because time zones are inherently confusing. The design problems are mostly things we haven't talked about here.