It isn't currently used elsewhere.  If we do ever use it elsewhere we should move it to a util function.

The desired output is that a TZ aware datetime should return the same encoding regardless of your system local time since it is fully specified.  A TZ naive datetime should assume your system local time zone and encode accordingly.

`time.mktime` assumes it's getting a time tuple in local time and then converts it to UTC.  If you pass it a TZ aware `datetime`, it still munges it based on local time.  `calendar.gmtime` assumes it's getting a time tuple in UTC.  Since there's no timezone information on a naive `datetime`, this just assumes that it's already in UTC and doesn't make an intelligent adjustment based on your system local time.

Luckily if your servers are already set to UTC (hopefully!) the behavior should be exactly the same.