Bug 552386 - test_history_sidebar.js fails between midnight and 2:00am with new DST settings, r=dietrich a=LegNeato
--- a/toolkit/components/places/src/nsNavHistory.cpp
+++ b/toolkit/components/places/src/nsNavHistory.cpp
@@ -3488,17 +3488,20 @@ PlacesSQLQueryBuilder::SelectAsDay()
PRExplodedTime tm;
PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &tm);
PRUint16 currentYear = tm.tm_year;
// Set day before month, setting month without day could cause issues.
// For example setting month to February when today is 30, since
// February has not 30 days, will return March instead.
tm.tm_mday = 1;
tm.tm_month -= MonthIndex;
- PR_NormalizeTime(&tm, PR_LocalTimeParameters);
+ // Notice we use GMTParameters because we just want to get the first
+ // day of each month. Using LocalTimeParameters would instead force us
+ // to apply a DST correction that we don't really need here.
+ PR_NormalizeTime(&tm, PR_GMTParameters);
// tm_month starts from 0 while GetMonthName expects a 1-based index.
history->GetMonthName(tm.tm_month+1, dateName);
// If the container is for a past year, add the year as suffix.
if (tm.tm_year < currentYear)
dateName.Append(nsPrintfCString(" %d", tm.tm_year));
// From start of MonthIndex + 1 months ago