I assume you've got the time checking bits working and you're just asking about updating the widget.
Firstly, updating the Clock is a bit harder as it's got an internal timer which is constantly updating the display. The clock widget has two parameters which may be relevant: "format" which controls the time formatting and "fmt" which is just set to "{}" so it will just display the formatted time.
Now, to update widgets from inside your config, you can do this:
from libqtile import qtile
clock = qtile.widgets_map["clock"]
# You now have access to the clock widget and all its internals
clock.update("Message here") # NB this will be overwritten with the next update call from the clock
Same approach can be used for a TextBox
from libqtile import qtile
textbox = qtile.widgets_map["textbox"] # You can pass the `name` value when initialising widgets in your Bar. The default is the classname in lower case so you'll need to add names if you have more than one textbox.
If you need more help, can you post a discussion on github please. It's impossible to format code nicely in google groups!