| | |
| | | return startDateStr, endDateStr
|
| | |
|
| | | # 开服天
|
| | | import DBDataMgr
|
| | | if startDateStr.isdigit():
|
| | | diffDay = GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | diffDay = DBDataMgr.GetEventTrigMgr().GetValue(ShareDefine.Def_ServerDay) + 1
|
| | | startDateTime = curDateTime + datetime.timedelta(days=(int(startDateStr)-diffDay))
|
| | | endDateTime = curDateTime + datetime.timedelta(days=(int(endDateStr)-diffDay))
|
| | |
|
| | | # K开服天
|
| | | elif startDateStr.startswith("K"):
|
| | | diffDay = GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | diffDay = DBDataMgr.GetEventTrigMgr().GetValue(ShareDefine.Def_ServerDay) + 1
|
| | | startDateTime = curDateTime + datetime.timedelta(days=(ToIntDef(startDateStr[1:])-diffDay))
|
| | | endDateTime = curDateTime + datetime.timedelta(days=(ToIntDef(endDateStr[1:])-diffDay))
|
| | |
|
| | | # 合服天
|
| | | elif startDateStr.startswith("Mix"):
|
| | | diffDay = GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_MixServerDay) + 1
|
| | | diffDay = DBDataMgr.GetEventTrigMgr().GetValue(ShareDefine.Def_MixServerDay) + 1
|
| | | startDateTime = curDateTime + datetime.timedelta(days=(int(startDateStr[3:])-diffDay))
|
| | | endDateTime = curDateTime + datetime.timedelta(days=(int(endDateStr[3:])-diffDay))
|
| | |
|
| | |
| | | # return serverID
|
| | | #return MainServerDict[serverID]
|
| | |
|
| | | ##获得当前服务器平台
|
| | | # @param 无
|
| | | # @return
|
| | | def GetPlatform():
|
| | | return ReadChConfig.GetPyMongoConfig("platform", "PlatformName")
|
| | |
|
| | | def GetAppID():
|
| | | ## 获取渠道ID
|
| | | return ReadChConfig.GetPyMongoConfig("platform", "AppID")
|
| | |
| | | return datetime.datetime.strptime(timeStr, timeFormat)
|
| | |
|
| | | def ChangeStrToDatetime(timeStr, timeFormat=ChConfig.TYPE_Time_Format):
|
| | | return datetime.datetime.strptime(timeStr, timeFormat)
|
| | | try:
|
| | | return datetime.datetime.strptime(timeStr, timeFormat)
|
| | | except:
|
| | | # 转化失败返回默认,如传入0也可转换
|
| | | return datetime.datetime(1970, 1, 1, 8, 0, 0)
|
| | |
|
| | | ## 时间格式转换成数值时间
|
| | | # @param dateT: datetime.datetime
|