The advent of charge-coupled devices and the subsequent implementation of ultrawide cameras for large imaging surveys has opened a new window for time-domain astronomy. In this book, our closest neighboring spiral galaxy - the Andromeda galaxy (M31) - is used as an example to walk readers through the ideas and techniques of time-domain analysis. This includes using image subtraction to obtain high quality time-series photometry, determining periods of variables using periodograms and classifying transients and variables based on the shapes of the light curves. It also highlights some science topics to showcase how we can use the time-domain data to shed light on the nature of the transient events and their progenitors.