Archived
next closest time
An old note — I haven't updated it since I wrote it.
Credit: stefan pochman
1def nextClosestTime(self, time):
2 return min((t <= time, t)
3 for i in range(24 * 60)
4 for t in ['%02d:%02d' % divmod(i, 60)]
5 if set(t) <= set(time))[1]