467,179 Members | 1,271 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,179 developers. It's quick & easy.

Diffrence between timestamps

i have got two timestamps as under:
Expand|Select|Wrap|Line Numbers
  1.  my $time1 = "2008-10-06  11:20:23";
  2. my $time2 = "2008-15-06  12:20:12";
i need to get difference between $time1 and $time2 i.e. i want $time3 should be equal to $time2-$time1. Is there any module to do the same? Please tell me.

Oct 22 '08 #1
  • viewed: 1596
1 Reply
Expert 2GB
Use the Time::Local module to convert the dates into epoch seconds then compute the difference. See the Time::Local modules documentation for details. It is a core module so your installation of perl will have it. If you get stuck after reading the documentation and writing and trying some code, post back.
Oct 22 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by lkrubner@geocities.com | last post: by
4 posts views Thread by rubbersoul | last post: by
5 posts views Thread by Robert Schuldenfrei | last post: by
4 posts views Thread by Craig G | last post: by
1 post views Thread by Erwin Van de Velde | last post: by
1 post views Thread by jitender164 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.