Here it would be nicer to calculate the constituent portions of the string and then combine them in a format string (you could even use locals() to get fancy), e.g.

    time_received = ...
    day_received = ...
    return "Message received at %(time_received)s %(day_received)s" % locals()