title: (OpenCV) put date in filename
body: <p>I want to save VideoCapture in some condition,
  so I wrote following code:</p>
  
  <pre><code>  date = datetime.now()
    detector = dlib.get_frontal_face_detector() 
    cap = cv2.VideoCapture(1)    #I use second camera
    global count, no_face
    total_number = 0
    count = 0
    no_face = 0
    num_bad_posture = 0
    not_detected_posture = 0
    while True:
  
          ret, frame = cap.read()
          frame = cv2.resize(frame,None,fx=sf,fy=sf, interpolation=cv2.INTER_AREA)
          gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
          dets = detector(gray,1) 
  
          if not dets:
                print('no face')
                no_face += 1
                if no_face &gt; 15:
                      print('no face!! for real!!')
                      now = str(date.now())
                      not_detected = cv2.resize(frame,None,fx=5,fy=5,interpolation = cv2.INTER_CUBIC)
                      not_detected_posture += 1
                      print(type(now))
                      cv2.imwrite('./images/non_detected/non_detected({0},{1}).jpg'. format(not_detected_posture,now),not_detected)
                      no_face=0
          for i, d in enumerate(dets):
                no_face = 0
                w = d.width()
                h = d.height()
                x = d.left()
                y = d.top()
  </code></pre>
  
  <p>If I run this code, the file is not saved.
  Also if I delete <code>date.now()</code> and just put <code>num_detected</code>, it is saved properly
  I have no idea what is wrong with the file name(because it's type is <code>str</code> and other <code>str</code>s are saved properly.</p>
  
  <p>Also if I do </p>
  
  <pre><code> print(type(now),now)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/sCXBo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sCXBo.jpg" alt="enter image description here"></a>
  it appears</p>
  
  <p>I need help.</p>