On 10 Jun 2004, at 9:25 AM, Dave Rolsky wrote:
What is half a minute? How long is half a month?

$dtd = DateTime::Duration->new( months => 1, minutes => 1, );

$half_dtd = $dtd / 2;

print $half_dtd->months . "\n";
# 0.5

print $half_dtd->seconds . "\n";
# 0.5

print strfduration(
normalise => 'ISO',
pattern => '%Y years, %m months, %e days, %H hours, %M minutes, %S seconds',
duration => $half_dtd
);
# 0 years, 0 months, 15 days, 0 hours, 0 minutes, 30 seconds




Senior Developer
PrintSupply - Print Procurement & Supply Management
18 Greenaway Street VIC 3105
Tel: (03) 9850 3255
Fx: (03) 9850 3277
http://www.printsupply.com.au/



Reply via email to