コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
21704 ビュー
最善の回答

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") 

アバター
破棄
関連投稿 返信 ビュー 活動
3
7月 23
27276
2
6月 22
5812
2
9月 21
4781
1
11月 20
8076
2
3月 19
6202