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 ...
随机推荐
- fragment和fragmentactivity解析
一.为什么要使用Fragment 1.当我们须要动态的多界面切换的时候,就须要将UI元素和Activity融合成一个模块.在2.3中我们一般通过各种Activity中进行跳转来实现多界面的跳转和单个 ...
- Error : The specified component was not reported by the VSS writer (Error 517) in Windows Server 2012 Backup
Error : The specified component was not reported by the VSS writer (Error 517) in Windows Server 201 ...
- velocity.properties配置说明
1.Runtime Log runtime.log = velocity.log 用以指定 Velocity 运行时日志文件的路劲和日志文件名,如不是全限定的绝对路径,系统会认为想对于 当前目录 ...
- C# 编程指南
此部分详细介绍了 C# 语言主要功能,以及通过 .NET Framework 可以在 C# 中使用的功能. 阅读此部分的大部分内容的前提是,你已对 C# 和一般编程概念有一定的了解. 如果完全没有接触 ...
- Java IO的简单示例
File类示例 public class FileUsageTest { private static void usage() { System.err.println("Usage: F ...
- 使用DBCA工具创建自己的数据库
ylbtech-Oracle:使用DBCA工具创建自己的数据库 DBCA创建数据库 默认安装的Oracle数据库一般不能满足实际应用的需求,例如数据库名称.数据库块的大小等都需要修改,那么我们应该自 ...
- Java:IO流的综合用法(从键盘录入数据并打印在控制台上)
import java.io.*; public class IOTestDouble { public static void main(String[] args)throws Exception ...
- hdu 1242 Rescue(BFS入门)
第一次用容器做的BFS题目,题目有个地方比较坑,就是遍历时的方向,比如上下左右能AC,右上左下就WA #include <stdio.h> #include <string.h> ...
- MyBatis两张表字段名相同产生的问题
MyBatis两张表字段名相同, 会导致bean属性都映射为第一个表的列, 解决方法: 通过设置别名的方式让其产生区别,如 <select id="queryBySekillId&qu ...
- apache 伪静态 .htaccess
虽然网上有很多教程,但是我在这里进行简单对我用到的总结一下. 加载Rewrite模块: 在conf目录下httpd.conf中找到 LoadModule rewrite_module modules/ ...