title: Show time before message in socket programming
body: <p>I want to make a messaging app. When I send a message, I want the clock to write before the message. How do I add the time? I'm about to go crazy..</p>
  <p>This is server codes.</p>
  <pre><code>global zaman
  zaman = str(time.strftime('%H') + &quot;:&quot; + time.strftime('%M') + &quot; - &quot;)
  
  def gelen_mesaj():
      while True:
          client, client_address = SERVER.accept()
          print(&quot;%s:%s bağlandı.&quot;%client_address)
          client.send(bytes(&quot;Şarj Takip Uygulaması \n&quot;+ &quot;Bağlantı İsminizi Giriniz: &quot;, &quot;utf-8&quot;))
          addresses[client] = client_address
          Thread(target=baglan_client, args=(client,)).start()
  
  def baglan_client(client):
      isim = client.recv(BUFFERSIZE).decode(&quot;utf-8&quot;)
      bisim = &quot;Bağlanan İsim %s.&quot;%isim
      client.send(bytes(bisim, &quot;utf-8&quot;))
      msg = &quot;%s, Takip Kanalına Bağlandı.&quot;%isim
      yayin(bytes(msg, &quot;utf-8&quot;))
      clients[client] = isim
      while True:
          msg = client.recv(BUFFERSIZE)
          if msg != bytes(&quot;{kapat}&quot;, &quot;utf-8&quot;):
              yayin(msg, isim +&quot;: &quot;)
          else:
              client.send(bytes(&quot;{kapat}&quot;, &quot;utf-8&quot;))
              client.close()
              del clients[client]
              yayin(bytes(&quot;%s Uygulamadan Çıkış Yaptı.&quot;%isim, &quot;utf-8&quot;))
              break
  </code></pre>
  <p>And clients codes</p>
  <pre><code>def gelen_mesaj():
      while True:
          try:
              msg = client_socket.recv(BUFFERSIZE).decode(&quot;utf8&quot;)
              mesaj_listesi.insert(tkinter.END, msg)
          except OSError:
              break
  
  def gonder(event=None):
      msg = mesajim.get()
      mesajim.set(&quot;&quot;)
      client_socket.send(bytes(msg, &quot;utf8&quot;))
      if msg == &quot;{kapat}&quot;:
          client_socket.close()
          app.quit()
  </code></pre>