The hard way is radix to seconds, delta, convert to minutes. An easier and less computationally expensive way is to row-wise delta, lkeave the negatives, and radix from there into seconds then convert.
it becomes computationally cheaper because most of the leading multiplications become by zero. You have to be careful on your index values and summations is all. On Sat, Jan 3, 2009 at 2:54 PM, David Vincent-Jones < [email protected]> wrote: > I have a series of time-stamps taken from a pump station where I need to > evaluate the operating intervals in minutes. > > The stamps run over day ends, month and even years so I am looking for a > simple way to count time from a fixed date .. even a recent date such as > '2008 01 01 00 00.00' would be fine. > > data example: > 2008 12 01 00 46 16 > 2008 12 01 01 46 19 > 2008 12 01 03 49 52 > 2008 12 01 04 49 56 > 2008 12 01 09 05 33 becomes via itemwise delta: index origin 2008 12 01 00 00 00 or 00 46 16, take your pick 0 0 0 presumed leader 0 0 0 1 0 3 2 3 33 1 0 4 5 -44 -23 radix convert taking into account the negative indexes, , then scan sum and convert to minutes or convert intermediate to 0 0 1 0.3 2 3.55 1 0.667 5 -44.396 This gets a little more complicated for day./month/year combination., in that the intervals become more erratic, but you can modulo an index table for each of those as fixed additions there as well. The problem size is small enough to precalculate an entire set of indexes down to the day or minute and just do a modulo index lookup polus add seconds. > > > I have been doing this the hard way with lots of 'intervention' but > probably somebody has already solved this elegantly and ideas would be > appreciated. > > David > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Use Reply-To: & thread your email after the first: or it may take a while, as I get 2000+ emails per day. -- Roy A. Crabtree UNC '76 gaa.lifer# 11086 703-318-2106 (msgs only, use my name) (mail, residence) Roy A. Crabtree 3322 Wheeler Road SE Oak Hill Apartments #T-4 Washington, DC 20032-4166 (secondary mail) Roy A. Crabtree USPS POB 58097 Washington, DC 20034-8097 [When you hear/read/see/feel what a y*ehudi plays/writes/sculpts/holds] [(n)either violinist {Menuhin} (n)or writer {"The Y*ehudi Principle"} (n)or molder (n)or older] [you must strive/think/look/sense all of it, or you will miss the meanings of it all] [email protected] Forwards only to: [email protected] [email protected] CC: auto to ^ http://musings-roy-crabtree.blogspot.com [& others] http://www.authorsden.com/royacrabtree http://skyscraper.fortunecity.com/activex/720/resume/full.doc -- (c) RAC/IP, ARE,PRO,PAST (Copyright) Roy Andrew Crabtree/In Perpetuity All Rights/Reserved Explicitly Public Reuse Only Profits Always Safe Traded ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
