콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
3266 화면

Hello,


I try to get the time in the user's time zone. Here is my code, generating an error:


user_tz = self.env.user.tz
MyDate = record.x_studio_approved_date_time_exit.user_tz
record['x_studio_time_exit'] = MyDate.strftime("%H:%M")


But it gives me an error... since the ".user_tz" is not supported.


Can you tell me how to solve this?


Thank you!




아바타
취소
작성자 베스트 답변

no, error is

ValueError: : "name 'env' is not defined" while evaluating.


With my code the error is:

ValueError: : "'datetime.datetime' object has no attribute 'user_tz'" while evaluating



아바타
취소
베스트 답변

Hi,

Did you tried with env.user.tz without self ?

Thanks

아바타
취소
관련 게시물 답글 화면 활동
2
2월 21
16427
1
10월 20
3479
2
8월 19
3817
0
9월 16
4408
1
4월 16
6750