date tells you the current time. You may use command line parameters to specify a format, see man date.
date
man date
For example for a UNIX timestamp (numbers you can easily compare), you can call date +%s.
date +%s