types and parsers for epoch time and absolute DateTime

I think there are tests already, just take a look at the examples there.


Chris

On Thu, Oct 30, 2014 at 9:29 AM, Sreekar M. Shastry <
notifications@github.com> wrote:

> In src/main/scala/timeserieszen/retrieval/AtTime.scala:
>
> > +    "ns"  -> { Nano(_: Long) }
> > +  )
> > +
> > +  def ordersOfMagnitude(x: Epoch): Int = {
> > +    x match {
> > +      case Sec(n) => 0
> > +      case Deci(n) => -1
> > +      case Centi(n) => -2
> > +      case Milli(n) => -3
> > +      case Micro(n) => -6
> > +      case Nano(n) => -9
> > +    }
> > +  }
> > +
> > +  def ordersOfMagnitudeToScale(x: Epoch, y: Epoch): Int = ordersOfMagnitude(x) - ordersOfMagnitude(y)
> > +  // invariant: (x.n)*10^ordersOfMagnitude(x,y) == y.n
>
> yeah. pending learning how to use scalacheck.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/stucchio/timeserieszen/pull/5/files#r19586864>.
>