Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
22185 Vues
Meilleure réponse

Hello Giezel Esteves,

     You have to use ORM methods to convert the datetime data to Different TZ(Time Zone).

     import pytz
    user_tz = self.env.user.tz or pytz.utc
    local = pytz.timezone(user_tz)
    display_date_result = datetime.strftime(pytz.utc.localize(datetime.strptime(your_date_or_datetime_info,
    DEFAULT_SERVER_DATETIME_FORMAT)).astimezone(local),"%d/%m/%Y %H:%M%S") 

Avatar
Ignorer
Publications associées Réponses Vues Activité
3
juil. 23
28150
2
juin 22
6230
2
sept. 21
5391
1
nov. 20
8696
2
mars 19
6609