# -*- coding: utf-8 -*- from openerp.http import request as r from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT from pytz import timezone from datetime import datetime def get_timezone(): return timezone(r.context['tz']) def get_datetime(): return datetime.now(get_timezone()).strftime(DEFAULT_SERVER_DATETIME_FORMAT) def get_date(): return datetime.now(get_timezone()).strftime(DEFAULT_SERVER_DATE_FORMAT)