How to set up OpenERP for various timezone kindly follow the following steps to select timezone in OpenERP
How to set up OpenERP for different Time Zones
Click on the “Edit Preferences” wheel at top right corner
How to set up OpenERP for different Time Zones
Click on the “Preferences” tab
How to set up OpenERP for different Time Zones
Select the timezone from Drop Down Menu
Following code will be working for “GMT-x” time zones. Mostly US based.
FMT = ”%Y-%m-%d %H:%M:%S” #Time Format
#########################Timezone Logic########################
timezone_time = self.pool.get(”res.users”).browse(cr,uid,uid).context_tz #Timezone selected in OpenERP
now_utc = datetime.now(timezone(”UTC”)) #fetching UTC time
now_utc1 = str(now_utc)[:19] #Truncating time only
now_tm = datetime.now() #system time
current_now = str(now_tm)[:19] #Truncating system time only
if timezone_time:
current_timezone = now_utc.astimezone(timezone(timezone_time)) #getting the time of selected timezone
current_timezone = str(current_timezone)[:19] #Truncating timezone time only
else:
current_timezone = current_now #Current time
###############################################################
#Difference between the UTC and Timezone time
UTC_timezn = datetime.strptime(now_utc1, FMT) – datetime.strptime(current_timezone, FMT)
#Difference between the Current and Timezone time
currnt_timezn = datetime.strptime(current_now, FMT) – datetime.strptime(current_timezone, FMT)
openerp_selected_tm = self.browse(cr,uid,ids[0]).last_ebay_order_import_date #getting user selected time from OpenERP
currentTimeFrom = datetime.strptime(openerp_selected_tm, FMT) – currnt_timezn #Subtracting the currnt_timezn from user selected time
Final_time = currentTimeFrom + UTC_timezn #Final time by adding UTC_timezn
How to set up OpenERP for various timezone kindly follow the following steps to select timezone in OpenERP的更多相关文章
- openerp 常见问题 OpenERP为什么选择了时区后时间还是不对?(转载)
OpenERP为什么选择了时区后时间还是不对? 原文地址:http://cn.openerp.cn/%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9%E4%B ...
- OpenERP 7中 openerp-server.conf 的解释
服务器启动配置 – 通用项 程序代码: [选择] # Admin password for creating, restoring and backing up databases admin_pas ...
- Odoo(OpenERP)配置文件详解
[options] ; addons模块的查找路径 addons_path = E:\GreenOdoo8.0\source\openerp\addons ; 管理员主控密码(用于创建.还原和备份数据 ...
- Warning: strftime(): It is not safe to rely on the system's timezone settings.
当运行程序时,会出现如下警告: Warning: strftime(): It is not safe to rely on the system's timezone settings. You a ...
- Date, TimeZone, MongoDB, java中date的时区问题
打印new Date(),Fri Aug 12 13:37:51 CST 2016. 显示Asia/Shanghai的时区,但是date toString 的时区简写却是CST.更坑爹的是,Googl ...
- OpenERP 使用与开发笔记(一)
一直关注OpenERP,但一直未真正使用.最近一些数据想规范管理,免得使和EXCEL与WORD等到处找,所以想到OpenERP的自定义功能比较好,就再次找来相关资料重新拾掇起来.在这过程中,发现了许多 ...
- HowTo: Linux Server Change OR Setup The Timezone
Method 1 #tzselect # select timezone e.g. Asia/Shanghai#echo 'Asia/Shanghai' > /etc/timezone # se ...
- Lumen 设置 timezone 时区
Lumen 设置 timezone 时区 2015-06-19| wid| 后端开发 今天用 Lumen 框架写代码时, 也是初次体验 Lumen, 遇到了一个问题, 从数据库里查出的时间比数据库里保 ...
- ubuntu 12.04上安装OpenERP 7的一次记录
登陆ssh, 先更新系统: sudo apt-get update && sudo apt-get dist-upgrade 接着再为openerp运行创建一个系统用户,用户名就叫op ...
随机推荐
- Digital Adjustment of DC-DC Converter Output Voltage in Portable Applications
http://pdfserv.maximintegrated.com/en/an/AN818.pdf http://www.maximintegrated.com/app-notes/index.mv ...
- High Voltage Boost Supply
http://learn.adafruit.com/ice-tube-clock-kit/design Tubes such as VFDs, Nixies, Decatrons, etc requi ...
- Nginx 作为反向Proxy 的优化要点
原文地址:http://my.oschina.net/hyperichq/blog/405421 常用优化要点 当nginx用于反向代理时,每个客户端将使用两个连接: 一个用于响应客户端的请求,另一个 ...
- 2. python 字符串常量
2. python 字符串常量 1.单双引号字符串是一样的 >>> 'abc',"abc" ('abc', 'abc') >>> 当 ...
- ExtJS GridPanel的ColumnModel 动态加载
var colM = "company,id,flyline"; var colMArr = colM.split(","); var colLength = ...
- RecyclerView源码分析(一)--整体设计
RecyclerView这个控件出来已经有一段时间了,如果看这篇文章的你,还没有使用过这个控件.那请先去学习怎样使用.不然看也白看.这里奉上一些关于介绍RecyclerView使用方法的优秀博客: 鸿 ...
- OTL翻译(8) -- otl_long_string/otl_long_unicode_string类
otl_long_string/olt_long_unicode_string 这两个类主要用来处理大对象数据.从OTL4.0版本开始,otl_long_string还可以处理任何类型的RAW/BIA ...
- 使用C#创建及调用WCF完整实例 (Windows服务宿主)
关于WCF的概念.原理.优缺点等,在这里就不多说了,网上很多,可以自行搜索,比我解释的要专业的多. 这里直接说使用Windows 服务(Windows Service)作为宿主如何实现,其它方式不在此 ...
- 20个代码生成框架 (.NET JAVA)
1.1 CodeSmith 一款人气很旺国外的基于模板的dotnet代码生成器 官方网站:http://www.codesmithtools.com 官方论坛:http://forum.codesmi ...
- 【java】jvm查看当前虚拟机堆大小限制
#############################################################jinfo -flag MaxHeapSize 6461#linux: jav ...