It's built in! (Part of the C standard library.)
That is, if you're building from the Arduino IDE you don't need to "get" anything. Just cut and paste exactly what I have above.
If you're building from Eclipse or from the command line g++/gcc, you might have to
#include <time.h>
or
#include <ctime> // C++-only variant
And you'll have to reorganize your code a bit: change Arduino-y setup() and loop() and Serial to main() and printf().