P
P
Petr Kolesnikov2021-03-08 18:52:49
Python
Petr Kolesnikov, 2021-03-08 18:52:49

How to remove date and seconds and leave only hours and minutes?

from kivy.app import App
from kivy.uix.label import Label
from kivy.clock import Clock

import time

class IncrediblyCrudeClock(Label):
def update(self, *args):
self.text = time.asctime()

class TimeApp(App ):
def build(self):
crudeclock = IncrediblyCrudeClock()
Clock.schedule_interval(crudeclock.update, 1)
return crudeclock

if __name__ == "__main__":
TimeApp().run()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeniy _, 2021-03-08
@GeneD88

self.text = time.strftime('%H:%M')
60468195a26e8822999828.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question