zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    falsh读取网页数据
    IBATISNET中的lazyLoad
    Json.Net学习笔记(四) Json对象的读写
    Json.Net学习笔记(五) 自定义Json序列化特性
    Json.Net学习笔记(三) Json与Xml之间的转换
    将 GridView 中的内容导出到 Excel 中多个工作表(Sheet) 的方法
    jQuery–20个最新的jQuery效果.
    Json.Net学习笔记(七) 序列化集合
    Json.Net学习笔记(六) Json.Net中关于时间的序列化
    Json.Net 学习笔记(一)
  • 原文地址:https://www.cnblogs.com/chjbbs/p/3610950.html
Copyright © 2011-2022 走看看