Packages

trait TimeHelpers extends AnyRef

The TimeHelpers trait provide functions to create TimeSpans (an object representing duration in milliseconds), to manage date formats or general utility functions (get the date for today, get year/month/day number,...)

Self Type
TimeHelpers with ControlHelpers
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TimeHelpers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class CalendarExtension extends AnyRef

    This class adds the setXXX methods to the Calendar class.

    This class adds the setXXX methods to the Calendar class. Each setter returns the updated Calendar

  2. class DateExtension extends AnyRef

    This class adds a noTime method the Date class, in order to get at Date object starting at 00:00

  3. implicit class DateTimeExtension extends AnyRef
  4. implicit class PeriodExtension [P] extends AnyRef
  5. class TimeSpan extends ConvertableToDate

    The TimeSpan class represents a duration of time in milliseconds.

    The TimeSpan class represents a duration of time in milliseconds. In this way, it is similar to the scala.concurrent.Duration class. It is mostly used in Lift APIs in similar positions as the Scala Duration class (for example, in event scheduling).

    Unlike in the Lift 2.x series, building a TimeSpan with a Long will not have different behavior depending on the value passed. Any passed Long will be used as a duration.

    Prior to Lift 3.0, TimeSpan was an amalgam of duration and joda DateTime, and allowed conversions between the two. As a result, operational semantics were poorly defined and it was easy to call a method that seemed like it should have simple duration semantics but run into DateTime semantics that made things more complicated instead.

    Lift 3.0 mostly maintains API compatibility with the Lift 2.x series, but introduces a series of deprecations to indicate places where dangerous and potentially unclear behavior may occur. Lift 3.1 will maintain API compatibility with all non-deprecated parts of the TimeSpan API, but will remove the deprecated aspects.

    For deprecated years and month builders it handle an operations on duration field values. Then it could be used only in to-period implicit conversion.

  6. case class TimeSpanBuilder (len: Long) extends Product with Serializable

    class building TimeSpans given an amount (len) and a method specify the time unit

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def boxParseInternetDate(dateString: String): Box[Date]

    returns

    a Box[date] from a string using the internet format.

  6. def calcTime[T](f: ⇒ T): (Long, T)

    returns

    the time taken to evaluate f in millis and the result

  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def currentYear: Int

    returns

    the current year

  9. def dateFormatter: SimpleDateFormat

    returns

    a standard format for the date yyyy/MM/dd

  10. def day(in: Date): Int

    returns

    the day of month corresponding to the input date (1 based)

  11. def days(in: Long): Long

    returns

    the number of millis corresponding to 'in' days

  12. def daysSinceEpoch: Long

    returns

    the number of days since epoch

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def formattedDateNow: String

    returns

    today's date formatted as yyyy/MM/dd

  17. def formattedTimeNow: String

    returns

    now's time formatted as HH:mm zzz

  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  20. def hourFormat(in: Date): String

    returns

    the formatted time for a given Date

  21. def hourFormat: SimpleDateFormat

    returns

    a standard format HH:mm:ss

  22. def hours(in: Long): Long

    returns

    the number of millis corresponding to 'in' hours

  23. implicit def intToTimeSpanBuilder(in: Int): (TimeHelpers.this)#TimeSpanBuilder

    transforms an int to a TimeSpanBuilder object.

    transforms an int to a TimeSpanBuilder object. Usage: 3.seconds returns a TimeSpan of 3000L millis

  24. def internetDateFormatter: SimpleDateFormat

    returns

    a formatter for internet dates (RFC822/1123) including: the day of week, the month, day of month, time and time zone

  25. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  26. def logTime[T](f: ⇒ (String, T)): T

    Call f and log the string returned together with the time taken in millis.

    Call f and log the string returned together with the time taken in millis.

    returns

    the second result from f

  27. def logTime[T](msg: String)(f: ⇒ T): T

    Log a message with the time taken in millis to do something and return the result

    Log a message with the time taken in millis to do something and return the result

    returns

    the result

  28. implicit def longToTimeSpanBuilder(in: Long): (TimeHelpers.this)#TimeSpanBuilder

    transforms a long to a TimeSpanBuilder object.

    transforms a long to a TimeSpanBuilder object. Usage: 3L.seconds returns a TimeSpan of 3000L millis

  29. def millis: Long

    returns

    the current number of millis: System.currentTimeMillis

  30. def millisToDays(millis: Long): Long

    returns

    the number of days since epoch converted from millis

  31. def minutes(in: Long): Long

    returns

    the number of millis corresponding to 'in' minutes

  32. def month(in: Date): Int

    returns

    the month corresponding to today (0 based, relative to UTC)

  33. def nano: Long

    returns

    the current System.nanoTime()

  34. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. final def notify(): Unit
    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  37. def now: Date

    returns

    the date object for now

  38. def nowAsInternetDate: String

    returns

    the current time as an internet date

  39. def parseInternetDate(dateString: String): Date

    returns

    a date from a string using the internet format. Return the Epoch date if the parse is unsuccesful

  40. def seconds(in: Long): Long

    returns

    the number of millis corresponding to 'in' seconds

  41. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  42. def time(when: Long): Date

    alias for new Date(millis)

  43. def timeFormatter: SimpleDateFormat

    returns

    a format for the time which includes the TimeZone: HH:mm zzz

  44. implicit def toCalendarExtension(c: Calendar): (TimeHelpers.this)#CalendarExtension

    implicit def used to add the setXXX methods to the Calendar class

  45. def toDate(in: Any): Box[Date]

    returns

    a Full(date) or a failure if the input couldn't be translated to date (or Empty if the input is null)

  46. implicit def toDateExtension(d: Date): (TimeHelpers.this)#DateExtension

    implicit def used to add the noTime method to the Date class

  47. def toInternetDate(in: Long): String

    returns

    a date formatted with the internet format (from a number of millis)

  48. def toInternetDate(in: Date): String

    returns

    a date formatted with the internet format

  49. def toString(): String
    Definition Classes
    AnyRef → Any
  50. def today: Calendar

    returns

    the Calendar object for today (the TimeZone is the local TimeZone). Its time is 00:00:00.000

  51. val utc: TimeZone

    The UTC TimeZone

  52. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. def weeks(in: Long): Long

    returns

    the number of millis corresponding to 'in' weeks

  56. def year(in: Date): Int

    returns

    the year corresponding to today (relative to UTC)

  57. object TimeSpan

    The TimeSpan object provides class represents an amount of time.

    The TimeSpan object provides class represents an amount of time. It can be translated to a date with the date method. In that case, the number of millis seconds will be used to create a Date object starting from the Epoch time (see the documentation for java.util.Date)

Deprecated Value Members

  1. implicit def intToTimeSpan(in: Int): (TimeHelpers.this)#TimeSpan

    transforms an int to a TimeSpan object.

    transforms an int to a TimeSpan object. Usage: 3000 returns a TimeSpan of 3000L millis

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Int to TimeSpan conversion will be removed for possibility of ambiguous behaviours, use TimeSpan(in) instead if you are using in.millis

  2. implicit def longToTimeSpan(in: Long): (TimeHelpers.this)#TimeSpan

    transforms a long to a TimeSpan object.

    transforms a long to a TimeSpan object. Usage: 3000L returns a TimeSpan of 3000L millis

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Long to TimeSpan conversion will be removed for possibility of ambiguous behaviours, use TimeSpan(in) instead if you are using in.millis

Inherited from AnyRef

Inherited from Any

Ungrouped