Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3793 Представления

Hi,

when i print my report i get always the time wrong (-1 hour) , and i don't know how to solve this problem .

i have this function in my code :

def _interpolation_dict(self):
        t = time.localtime() # Actually, the server is always in UTC.
        return {
            'year': time.strftime('%Y', t),
            'month': time.strftime('%m', t),
            'day': time.strftime('%d', t),
            'y': time.strftime('%y', t),
            'doy': time.strftime('%j', t),
            'woy': time.strftime('%W', t),
            'weekday': time.strftime('%w', t),
            'h24': time.strftime('%H', t),
            'h12': time.strftime('%I', t),
            'min': time.strftime('%M', t),
            'sec': time.strftime('%S', t),
        }


 

Аватар
Отменить
Related Posts Ответы Просмотры Активность
3
янв. 21
21498
3
мар. 24
4305
0
окт. 16
3747
1
июн. 22
2091
2
мар. 22
8570