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. TimeHelpers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
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. class TimeSpan extends ConvertableToDate

    The TimeSpan class represents an amount of time.

    The TimeSpan 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)

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

  5. final def asInstanceOf[T0]: T0

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

    returns

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

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

    returns

    the time taken to evaluate f in millis and the result

  8. def clone(): AnyRef

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

    returns

    the current year

  10. def dateFormatter: SimpleDateFormat

    returns

    a standard format for the date yyyy/MM/dd

  11. def day(in: Date): Int

    returns

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

  12. def days(in: Long): Long

    returns

    the number of millis corresponding to 'in' days

  13. def daysSinceEpoch: Long

    returns

    the number of days since epoch

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def formattedDateNow: String

    returns

    today's date formatted as yyyy/MM/dd

  18. def formattedTimeNow: String

    returns

    now's time formatted as HH:mm zzz

  19. final def getClass(): Class[_]

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

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

    returns

    the formatted time for a given Date

  22. def hourFormat: SimpleDateFormat

    returns

    a standard format HH:mm:ss

  23. def hours(in: Long): Long

    returns

    the number of millis corresponding to 'in' hours

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

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

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

  27. final def isInstanceOf[T0]: Boolean

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

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

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

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

  32. def millis: Long

    returns

    the current number of millis: System.currentTimeMillis

  33. def millisToDays(millis: Long): Long

    returns

    the number of days since epoch converted from millis

  34. def minutes(in: Long): Long

    returns

    the number of millis corresponding to 'in' minutes

  35. def month(in: Date): Int

    returns

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

  36. def nano: Long

    returns

    the current System.nanoTime()

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

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

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

    Definition Classes
    AnyRef
  40. def now: Date

    returns

    the date object for now

  41. def nowAsInternetDate: String

    returns

    the current time as an internet date

  42. def parseInternetDate(dateString: String): Date

    returns

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

  43. def seconds(in: Long): Long

    returns

    the number of millis corresponding to 'in' seconds

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

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

    alias for new Date(millis)

  46. def timeFormatter: SimpleDateFormat

    returns

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

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

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

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

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

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

  50. def toInternetDate(in: Long): String

    returns

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

  51. def toInternetDate(in: Date): String

    returns

    a date formatted with the internet format

  52. def toString(): String

    Definition Classes
    AnyRef → Any
  53. def today: Calendar

    returns

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

  54. val utc: TimeZone

    The UTC TimeZone

  55. final def wait(): Unit

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

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

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

    returns

    the number of millis corresponding to 'in' weeks

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6) 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

Ungrouped