diff --git a/hgext/churn.py b/hgext/churn.py
index 379dd054614bdf645712ee51ac172c8b08ab3dc2_aGdleHQvY2h1cm4ucHk=..6f3e733848aeb5f7266d3e21373f1b9045cacdda_aGdleHQvY2h1cm4ucHk= 100644
--- a/hgext/churn.py
+++ b/hgext/churn.py
@@ -52,7 +52,8 @@
         def getkey(ctx):
             t, tz = ctx.date()
             date = datetime.datetime(*time.gmtime(float(t) - tz)[:6])
-            return date.strftime(encoding.strfromlocal(opts['dateformat']))
+            return encoding.strtolocal(
+                date.strftime(encoding.strfromlocal(opts['dateformat'])))
     else:
         tmpl = opts.get('oldtemplate') or opts.get('template')
         tmpl = logcmdutil.maketemplater(ui, repo, tmpl)