Options
All
  • Public
  • Public/Protected
  • All
Menu

Utility methods to work with time

since

1.0

Hierarchy

  • TimeUtil

Index

Properties

Static INSTANT_MAX

INSTANT_MAX: number = Number.MAX_SAFE_INTEGER / 1000

Value of the maximum Instant

since

1.0

Static INSTANT_MIN

INSTANT_MIN: number = Number.MIN_SAFE_INTEGER / 1000

Value of the minimum Instant

since

1.0

Methods

Static fromInstant

  • fromInstant(instant: Instant): number
  • Convert a Joda-Js Instant into the corresponding time as number

    since

    1.0

    Parameters

    • instant: Instant

      to convert in number

    Returns number

    time as number corresponding to the given ```Instant``

Static fromMillis

  • fromMillis(millis: number): number
  • Returns the time in second represented by the value in millis

    since

    1.0

    Parameters

    • millis: number

      the time in milli seconds we want to convert in second

    Returns number

    the time in second represented by the value in millis

Static now

  • now(): number
  • Returns the current date as number

    since

    1.0

    Returns number

    the current date as number

Static ofDays

  • ofDays(days: number): number
  • Returns the number associated to the given number of days

    since

    1.0

    Parameters

    • days: number

      the number of days to convert to second

    Returns number

    the number of seconds associated the given number of days

Static ofHours

  • ofHours(hours: number): number
  • Returns the time in seconds from the given hours

    since

    1.0

    Parameters

    • hours: number

      to convert to second

    Returns number

    the number of seconds associated to the given hours

Static toInstant

  • toInstant(seconds: number): Instant
  • Convert a time as number into Joda-Js Instant

    since

    1.0

    Parameters

    • seconds: number

      to convert to Instant

    Returns Instant

    instant corresponding to the given time

Static toMillis

  • toMillis(seconds: number): number
  • Returns the time in milliseconds represented by the value in seconds

    since

    1.0

    Parameters

    • seconds: number

      the time in seconds we want to convert in milli seconds

    Returns number

    the time in millis represented by the value in seconds

Static toZonedDateTime

  • toZonedDateTime(time: number, zoneId: ZoneId): ZonedDateTime
  • Parameters

    • time: number
    • zoneId: ZoneId

    Returns ZonedDateTime