in reply to how to calculate time that looks like 1138597506

That's the time given as the number of seconds since midnight, Jan 1st 1970 GMT (known as the epoch). Perl will give the current value for that number using the time function.

You can convert from that number back to a more human-understandable representation using localtime or gmtime.

You can create one of these "epoch seconds" numbers for a given date and time using the timelocal or timegm functions from the Time::Local module.

  • Comment on Re: how to calculate time that looks like 1138597506