How do digital timer switches work?

How do digital timer switches work?