On Fri, 14 Sep 2018 11:55:18 -0400 Peter Kleiner <runtfan71@xxxxxxxxx> wrote: > On Fri, Sep 14, 2018 at 11:51 AM David Gauthier > <davegauthierpg@xxxxxxxxx> wrote: > > > > Hi: > > > > In perl/DBI, I have code that's getting me an "age" which returns > > something like... "-17 days -08:29:35". How can I convert that to > > a number of hours (as a float I would presume) ? Suggest using one of the date modules. One issue is that not all days are 86400s long: "leap second" is used to keep atomic clocks in sync with siderial time so that telescopes report consistent values over time. Catch is that simply dividing by 3600 doesn't always work if the times fall across the wrong days. You would normally want an integer for these rather than float as the result to avoid rounding issues on extract or with comparisions in or out of the database. You will normally not have more than one second precision on times (timestamps are a different matter). Q: What database are you using? Postgres makes it easy enough to cast the values or compute the difference is seconds. -- Steven Lembark 3920 10th Ave South Workhorse Computing Birmingham, AL 35222 lembark@xxxxxxxxxxx +1 888 359 3508