code: func jobFinishTime(finishedJob *batch.Job) (metav1.Time, error) {
  	for _, c := range finishedJob.Status.Conditions {
  		if (c.Type == batch.JobComplete || c.Type == batch.JobFailed) && c.Status == v1.ConditionTrue {
  			finishAt := c.LastTransitionTime
  			if finishAt.IsZero() {
  				return metav1.Time{}, fmt.Errorf("unable to find the time when the Job %s/%s finished", finishedJob.Namespace, finishedJob.Name)
  			}
  			return c.LastTransitionTime, nil
  		}
  	}
  
  	// This should never happen if the Jobs has finished
  	return metav1.Time{}, fmt.Errorf("unable to find the status of the finished Job %s/%s", finishedJob.Namespace, finishedJob.Name)
  }
docs: // jobFinishTime takes an already finished Job and returns the time it finishes.