Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. $date1 = Fri Aug 30 10:53:38 2013
  2. $date2 = Fri Aug 30 02:12:25 2013
  3.  
  4. #!/usr/bin/perl
  5.  
  6. use strict;
  7. use warnings;
  8. use 5.010;
  9. use Time::Piece;
  10.  
  11. my $date1 = 'Fri Aug 30 10:53:38 2013';
  12. my $date2 = 'Fri Aug 30 02:12:25 2013';
  13.  
  14. my $format = '%a %b %d %H:%M:%S %Y';
  15.  
  16. my $diff = Time::Piece->strptime($date1, $format)
  17. - Time::Piece->strptime($date2, $format);
  18.  
  19. say $diff;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement