LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Zefram Date: Wed Oct 1 10:28:17 2008 Subject: Re: I'd tell you how long it'll take for my hair to fall out but I'm struggling with duration!
Kristian Flint wrote: >definitely a fixed number of seconds in a day Leap seconds. DateTime doesn't really do them correctly -- actually its time scale is a bit schizophrenic at the sub-second level -- but it does represent leap seconds that it knows about. So some days, about one in 500, have 86401 seconds. > (actually unless we're >talking about that tiny fraction that ends up counting towards a quarter >of a day per year?). No. That's a leap day occuring roughly every four years, which means that there isn't a fixed number of days per year. >This doesn't actually return what's stated above (#) but actually >returns >0 years, 41 months, 1 days, 00 hours, 375 minutes, 45 seconds Hmm, yes. DateTime::Duration is normalising to that form. DT::F::Duration is only showing what it gets from DT::Duration. Looks like DT::F::Duration is trying to normalise the other way, back to what you input, but that's going wrong somewhere. >And if I try and make the pattern => '%e' to just get the number of >days, this returns 0! Returns 1 for me. -zefram
| Navigate in group perl.datetime at sever nntp.perl.org | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |