in reply to question about unix timestamps (epoch)
my $_timestamp1 = '1189669351'; my $_timestamp2 = '1189355751'; printf "rounded: %.0f\n",($_timestamp1 - $_timestamp2) / 86400; print "truncated: ",int( ($_timestamp1 - $_timestamp2) / 86400),"\n"; print "float: ",(($_timestamp1 - $_timestamp2) / 86400),"\n"; __END__ rounded: 4 truncated: 3 float: 3.62962962962963
I think using a module for such a simple operation is a bit overkill, but that's just me.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|