A handy Perl script to calculate duration in seconds
来源:互联网 发布:淘宝上做什么产品好 编辑:程序博客网 时间:2024/04/30 16:16
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
my $dt2 = DateTime->new(
year => 2013,
month => 8,
day => 2,
hour => 9,
minute => $ARGV[0],
second => $ARGV[1],
time_zone => 'local',
);
my $dt1 = DateTime->new(
year => 2013,
month => 8,
day => 2,
hour => 9,
minute => $ARGV[2],
second => $ARGV[3],
time_zone => 'local',
);
my $duration = int($dt1->subtract_datetime_absolute($dt2)->delta_seconds);
print "duration: $duration\n";
__END__
use strict;
use warnings;
use DateTime;
my $dt2 = DateTime->new(
year => 2013,
month => 8,
day => 2,
hour => 9,
minute => $ARGV[0],
second => $ARGV[1],
time_zone => 'local',
);
my $dt1 = DateTime->new(
year => 2013,
month => 8,
day => 2,
hour => 9,
minute => $ARGV[2],
second => $ARGV[3],
time_zone => 'local',
);
my $duration = int($dt1->subtract_datetime_absolute($dt2)->delta_seconds);
print "duration: $duration\n";
__END__
- A handy Perl script to calculate duration in seconds
- A handy .NET class to help manage long operations in AutoCAD
- A Handy Guide To Handling Handles
- How to write a script in Linux
- How to run a script in ubuntu?
- A Python Script to Disassemble a Block in LLDB
- calculate a point in triangle
- ORA-1555 Reported with Query Duration = 0 , or a Few Seconds
- What's the easiest way to call a function every 5 seconds in jQuery?
- Script To Release Hold In A Sales Order
- How to use ActiveRecord in a ruby script outside Rails?
- how to write a configure script in linux
- Powershell: how to get functions defined in a script?
- How to calculate the MD5 hash of a large file in C?
- come in handy
- send files to a ftp server in PERL
- How to calculate CRC in C#?
- Your task is to Calculate a + b.
- Linux 开机引导与关机过程
- Haskell是个神码语言
- C++ Primer 学习笔记(4)——标准库string类型
- Scrollbars & Scrolling
- Spring security 认证-ch01
- A handy Perl script to calculate duration in seconds
- 基于mini2440的USB视频采集
- shell for 循环写法总结
- Linux下C开发,怎么做成库文件,又怎么引用这个库文件?
- android Touch事件详解(解决冲突问题)
- 正则表达式全部符号解释
- Google Maps V3 之 路线服务
- java反射机制
- 加载外部xml