Пример #1
0
 def get_update_date(self, issue):
     result = "--"
     if issue.UpdateTime:
         result = DateTimeHelper.how_long_ago(
             (datetime.datetime.now().replace(
                 tzinfo=pytz.timezone(TIME_ZONE)) -
              issue.UpdateTime).seconds)
     return result
Пример #2
0
 def update_date(self):
     result = "--"
     if self.issue.ResolvedTime:
         result = DateTimeHelper.how_long_ago(
             (datetime.datetime.now().replace(
                 tzinfo=pytz.timezone('Asia/Shanghai')) -
              self.issue.ResolvedTime).seconds)
     return result
 def get_ActionTimeStr(self, obj):
     now = datetime.datetime.strptime(
         datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
         "%Y-%m-%d %H:%M:%S")
     action_time = datetime.datetime.strptime(
         obj.ActionTime.strftime("%Y-%m-%d %H:%M:%S"), "%Y-%m-%d %H:%M:%S")
     action_time = action_time + datetime.timedelta(hours=8)
     time_internal = (now - action_time).total_seconds()
     return DateTimeHelper.how_long_ago(time_internal)