net.liftweb.util

TimeHelpers

trait TimeHelpers extends AnyRef

The TimeHelpers trait provide functions to create TimeSpans (an object representing an amount of time), 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
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. TimeHelpers
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Type Members

  1. class CalendarExtension extends AnyRef

    This class adds the setXXX methods to the Calendar class.

  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. class TimeSpan extends ConvertableToDate

    The TimeSpan class represents an amount of time.

  4. 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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object TimeSpan extends AnyRef

    The TimeSpan object provides class represents an amount of time.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def boxParseInternetDate(dateString: String): Box[Date]

    returns

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

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

    returns

    the time taken to evaluate f in millis and the result

  10. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def currentYear: Int

    returns

    the current year

  12. def dateFormatter: SimpleDateFormat

    returns

    a standard format for the date yyyy/MM/dd

  13. def day(in: Date): Int

    returns

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

  14. def days(in: Long): Long

    returns

    the number of millis corresponding to 'in' days

  15. def daysSinceEpoch: Long

    returns

    the number of days since epoch

  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  19. def formattedDateNow: String

    returns

    today's date formatted as yyyy/MM/dd

  20. def formattedTimeNow: String

    returns

    now's time formatted as HH:mm zzz

  21. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  23. def hourFormat(in: Date): String

    returns

    the formatted time for a given Date

  24. def hourFormat: SimpleDateFormat

    returns

    a standard format HH:mm:ss

  25. def hours(in: Long): Long

    returns

    the number of millis corresponding to 'in' hours

  26. implicit def intToTimeSpan(in: Int): TimeSpan

    transforms an int to a TimeSpan object.

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

  27. implicit def intToTimeSpanBuilder(in: Int): TimeSpanBuilder

    transforms an int to a TimeSpanBuilder object.

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

  28. 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

  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. 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

  31. 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

  32. implicit def longToTimeSpan(in: Long): TimeSpan

    transforms a long to a TimeSpan object.

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

  33. implicit def longToTimeSpanBuilder(in: Long): TimeSpanBuilder

    transforms a long to a TimeSpanBuilder object.

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

  34. def millis: Long

    returns

    the current number of millis: System.currentTimeMillis

  35. def millisToDays(millis: Long): Long

    returns

    the number of days since epoch converted from millis

  36. def minutes(in: Long): Long

    returns

    the number of millis corresponding to 'in' minutes

  37. def month(in: Date): Int

    returns

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

  38. def nano: Long

    returns

    the current System.nanoTime()

  39. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  40. final def notify(): Unit

    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  42. def now: Date

    returns

    the date object for now

  43. def nowAsInternetDate: String

    returns

    the current time as an internet date

  44. def parseInternetDate(dateString: String): Date

    returns

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

  45. def seconds(in: Long): Long

    returns

    the number of millis corresponding to 'in' seconds

  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  47. def time(when: Long): Date

    alias for new Date(millis)

  48. def timeFormatter: SimpleDateFormat

    returns

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

  49. implicit def toCalendarExtension(c: Calendar): CalendarExtension

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

  50. 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)

  51. implicit def toDateExtension(d: Date): DateExtension

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

  52. def toInternetDate(in: Long): String

    returns

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

  53. def toInternetDate(in: Date): String

    returns

    a date formatted with the internet format

  54. def toString(): String

    Definition Classes
    AnyRef → Any
  55. def today: Calendar

    returns

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

  56. val utc: TimeZone

    The UTC TimeZone

  57. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  58. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  59. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  60. def weeks(in: Long): Long

    returns

    the number of millis corresponding to 'in' weeks

  61. def year(in: Date): Int

    returns

    the year corresponding to today (relative to UTC)

Deprecated Value Members

  1. def dayNow: Date

    returns

    the current Day as a Date object

    Deprecated

    use today instead

  2. def timeNow: Date

    returns

    the current time as a Date object

    Annotations
    @deprecated
    Deprecated

    (Since version 2.4) use now instead

Inherited from AnyRef

Inherited from Any