ForNext
Only Do What Only You Can Do
086. result of date subtraction
Hyperpolyglot Interpreted Languages: PHP, Perl, Python, Ruby より (2012.05.08)
VBScript
JScript
Perl
Time::Seconds object if use Time::Piece in effect; not meaningful to subtract tm arrays
PHP
DateInterval object if diff method used: $fmt = "Y-m-d H:i:s"; $s = "2011-05-03 10:00:00"; $then = DateTime::createFromFormat($fmt, $s); $now = new DateTime("now"); $interval = $now->diff($then);
Python
datetime.timedelta object
Ruby
Float containing time difference in seconds