Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

paulm (5067)

paulm
  (email not shown publicly)
http://paulm.com/
Jabber: Tantrix@jabber.org

Hello! I'm Paul Makepeace [paulm.com], a regular on London.pm [pm.org]. Perl's my primary language I code in (since '95 I think); people even pay me [paulmakepeace.com] for it! Although I'd say I'm a developer I spend a substantial chunk of time being a sysadmin for my own machines (I'm also one of london.pm.org's root), all Debian boxen.

This journal is my first foray into a technical annotation of my perl life...

Journal of paulm (5067)

Monday February 14, 2005
11:22 AM

25 hours in a day

[ #23190 ]

sub days_between($$) {
    (str2time($_[1])-str2time($_[0])) / SECONDS_IN_A_DAY;
}

Seems obvious enough. Then some results were non-integer. Boiled down to,

$ perl -MDate::Parse -le 'print ((str2time($ARGV[1])-str2time($ARGV[0]))/86400)' 2004-10-31  2004-11-01
1.04166666666667
$

Why? Ah, Daylight savings!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.