def _get_hour(self, msg=False):
    chart_date = self.request.GET.get('date', None)
    if chart_date:
        try:
            hour = self.request.GET.get('hour', '00')
            return KR_TZ.localize(datetime.strptime('{}{}'.format(chart_date, hour), '%Y%m%d%H'))
        except ValueError:
            if msg:
                messages.error(self.request, 'Invalid date/hour parameters.')
    return AggregateHourlySongChart.objects.latest('hour').hour.astimezone(KR_TZ)
def _get_hour(self, msg=False):
    chart_date = self.request.GET.get('date', None)
    if chart_date:
        try:
            hour = self.request.GET.get('hour', '00')
            return KR_TZ.localize(datetime.strptime('{}{}'.format(chart_date, hour), '%Y%m%d%H'))
        except ValueError:
            if msg:
                messages.error(self.request, 'Invalid date/hour parameters.')
    return AggregateHourlySongChart.objects.latest('hour').hour.astimezone(KR_TZ)