Epoch in Perl

Hi,
Can anybody tell me how time is calculated in the below or what is actually being done here?
Also can you explain in simple words about epoch time and why it is used?

Thanks in advance

  1. Read perldoc about localtime and timelocal. If you're still unable to understand, please get back with the specifics and we'll surely help you. If you understand localtime, you'll be able to figure out your code in post #1 by yourself.
  2. Epoch is a reference point in time. On most unix systems and programming languages like C, Java, perl, etc, epoch is "01-Jan-1970 00:00:00". Usually current time defined in number of seconds elapsed from epoch is a neater way to handle time related features. There are online tools available for conversion of current time to time in seconds from epoch.