home > 比較編 > Perl, PHP, Python, Ruby > dates and time >

ForNext

Only Do What Only You Can Do

086. result of date subtraction

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





PowerShell

Scala

F#

C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system