1234567891011121314151617181920 |
- # -*- coding: utf-8 -*-
- from openerp.http import request
- 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(request.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)
|